{"action":"closed","issue":{"url":"https://api.github.com/repos/marvinroger/async-mqtt-client/issues/12","repository_url":"https://api.github.com/repos/marvinroger/async-mqtt-client","labels_url":"https://api.github.com/repos/marvinroger/async-mqtt-client/issues/12/labels{/name}","comments_url":"https://api.github.com/repos/marvinroger/async-mqtt-client/issues/12/comments","events_url":"https://api.github.com/repos/marvinroger/async-mqtt-client/issues/12/events","html_url":"https://github.com/marvinroger/async-mqtt-client/issues/12","id":162299127,"number":12,"title":"Compilation error if this library is not used in .ino file","user":{"login":"eos1d3","id":16335499,"avatar_url":"https://avatars.githubusercontent.com/u/16335499?v=3","gravatar_id":"","url":"https://api.github.com/users/eos1d3","html_url":"https://github.com/eos1d3","followers_url":"https://api.github.com/users/eos1d3/followers","following_url":"https://api.github.com/users/eos1d3/following{/other_user}","gists_url":"https://api.github.com/users/eos1d3/gists{/gist_id}","starred_url":"https://api.github.com/users/eos1d3/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/eos1d3/subscriptions","organizations_url":"https://api.github.com/users/eos1d3/orgs","repos_url":"https://api.github.com/users/eos1d3/repos","events_url":"https://api.github.com/users/eos1d3/events{/privacy}","received_events_url":"https://api.github.com/users/eos1d3/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/marvinroger/async-mqtt-client/labels/question","name":"question","color":"cc317c"}],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":4,"created_at":"2016-06-25T20:52:57Z","updated_at":"2016-06-26T13:11:43Z","closed_at":"2016-06-26T13:11:43Z","body":"I found that this library must be used and included only in main .ino file. \r\n\r\nI created a new sketch together with a cpp (mqtt.cpp) file. In cpp file I want to do all these mqtt tasks.\r\nThese are the only two lines of codes in cpp file:\r\n\r\n\r\n```\r\n#include <ESP8266WiFi.h>\r\n#include <AsyncMqttClient.h>\r\n```\r\n\r\nAnd I always get warning at the second line:\r\n```\r\n\r\nArduino: 1.6.9 (Windows 10), Board: \"NodeMCU 1.0 (ESP-12E Module), 80 MHz, 921600, 4M (3M SPIFFS)\"\r\n\r\nIn file included from C:\\Users\\eos1d3\\AppData\\Local\\Arduino15\\packages\\esp8266\\hardware\\esp8266\\2.3.0\\libraries\\ESP8266WiFi\\src/WiFiClient.h:25:0,\r\n\r\n                 from C:\\Users\\eos1d3\\AppData\\Local\\Arduino15\\packages\\esp8266\\hardware\\esp8266\\2.3.0\\libraries\\ESP8266WiFi\\src/ESP8266WiFi.h:39,\r\n\r\n                 from sketch\\mqtt.cpp:2:\r\n\r\nc:\\users\\eos1d3\\appdata\\local\\arduino15\\packages\\esp8266\\tools\\xtensa-lx106-elf-gcc\\1.20.0-26-gb404fb9-2\\xtensa-lx106-elf\\include\\c++\\4.8.2\\bits\\stl_vector.h: In member function 'std::vector<_Tp, _Alloc>::size_type std::vector<_Tp, _Alloc>::_M_check_len(std::vector<_Tp, _Alloc>::size_type, const char*) const':\r\n\r\nC:\\Users\\eos1d3\\AppData\\Local\\Arduino15\\packages\\esp8266\\hardware\\esp8266\\2.3.0\\cores\\esp8266/Arduino.h:253:18: error: expected unqualified-id before '(' token\r\n\r\n #define max(a,b) ((a)>(b)?(a):(b))\r\n\r\n                  ^\r\n\r\nc:\\users\\eos1d3\\appdata\\local\\arduino15\\packages\\esp8266\\tools\\xtensa-lx106-elf-gcc\\1.20.0-26-gb404fb9-2\\xtensa-lx106-elf\\include\\c++\\4.8.2\\bits\\stl_bvector.h: In member function 'std::vector<bool, _Alloc>::size_type std::vector<bool, _Alloc>::_M_check_len(std::vector<bool, _Alloc>::size_type, const char*) const':\r\n\r\nC:\\Users\\eos1d3\\AppData\\Local\\Arduino15\\packages\\esp8266\\hardware\\esp8266\\2.3.0\\cores\\esp8266/Arduino.h:253:18: error: expected unqualified-id before '(' token\r\n\r\n #define max(a,b) ((a)>(b)?(a):(b))\r\n\r\n                  ^\r\n\r\nexit status 1\r\nError compiling for board NodeMCU 1.0 (ESP-12E Module).\r\n\r\n```\r\n\r\nIf I move the codes in cpp to .ino file, it compiles fine.\r\nAnd I also downgraded ESP8266 core to 2.2, the problem is still the same.\r\n\r\n"}}
{"actor":{"display_login":"marvinroger"}}