WifiPixels icon indicating copy to clipboard operation
WifiPixels copied to clipboard

compilation error

Open wutu opened this issue 8 years ago • 1 comments

greetings, very nice project! I got this error when compiling with Arduino IDE 1.6.7 and 1.6.5.

In file included from C:\Users\wutu\Documents\Arduino\WifiPixels\examples\WifiPixels_MQTT_NeoPixel\WifiPixels_MQTT_NeoPixel.ino:8:0:

mqtt_helper.h:6: error: 'MQTT' does not name a type

 typedef void(*callback_t)(const MQTT::Publish&);

                                 ^

mqtt_helper.h:6: error: expected unqualified-id before '&' token

 typedef void(*callback_t)(const MQTT::Publish&);

                                              ^

mqtt_helper.h:6: error: expected ')' before '&' token

mqtt_helper.h:6: error: expected initializer before ')' token

 typedef void(*callback_t)(const MQTT::Publish&);

                                               ^

mqtt_helper.h:11: error: 'callback_t' has not been declared

     void mqttSetup(String server,int port,String user,String password,String clientID,callback_t cb,String topic);

                                                                                       ^

mqtt_helper.h:13: error: 'callback_t' has not been declared

     void ConnectToMQTTServer(callback_t cb);

                              ^

mqtt_helper.h:19: error: 'callback_t' does not name a type

     callback_t mqttCB;

     ^

WifiPixels_MQTT_NeoPixel:13: error: 'MQTT' does not name a type

 void callback(const MQTT::Publish& pub) {

                     ^

WifiPixels_MQTT_NeoPixel:13: error: expected unqualified-id before '&' token

 void callback(const MQTT::Publish& pub) {

                                  ^

WifiPixels_MQTT_NeoPixel:13: error: expected ')' before '&' token

WifiPixels_MQTT_NeoPixel:13: error: expected initializer before 'pub'

 void callback(const MQTT::Publish& pub) {

                                    ^

C:\Users\wutu\Documents\Arduino\WifiPixels\examples\WifiPixels_MQTT_NeoPixel\WifiPixels_MQTT_NeoPixel.ino: In function 'void setup()':

WifiPixels_MQTT_NeoPixel:48: error: 'callback' was not declared in this scope

   mqtt_helper->mqttSetup("m11.cloudmqtt.com",0,"xxx","xxx","Client3451",callback,"/test/buttonPressed");

                                                                         ^

Using library ESP8266WiFi at version 1.0 in folder: C:\Users\wutu\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.0.0\libraries\ESP8266WiFi 
Using library ESP8266WebServer at version 1.0 in folder: C:\Users\wutu\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.0.0\libraries\ESP8266WebServer 
Using library PubSubClient at version 2.4 in folder: C:\Users\wutu\Documents\Arduino\libraries\PubSubClient 
Using library EEPROM at version 1.0 in folder: C:\Users\wutu\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.0.0\libraries\EEPROM 
Using library NeoPixelBus in folder: C:\Users\wutu\Documents\Arduino\libraries\NeoPixelBus (legacy)
exit status 1
'MQTT' does not name a type

wutu avatar Mar 07 '16 16:03 wutu

Got it to work, you need to download an older version of PubSubClient. V.1.99.1 worked for me.

Aircoookie avatar Aug 15 '16 20:08 Aircoookie