Compiler Error

Hi All,

I get the following error when I try and compile code with an ESP8266.

I have been following this guide. Any ideas?

1 Like

Hiya @Theo272603
Welcome to the forums.

The error means the linker doesn’t know what an MQTT object is.
Quick things to check.
Have you got this library installed?

The error is also suggesting an alternate object : MQTT_H. Have you tried that?

1 Like

Hi Theo,

Welcome to the forums!

Pix is already on top of my thoughts, MQTT should be found within the EasyIoT Library. Where did you get your code from?

1 Like

thanks Pix and Jack, MQTT seems to be installed see image

code was downloaded from here

EasyIoT-Cloud/esp8266_mqtt_switch1/esp8266_mqtt_switch1.ino at master · iot-playground/EasyIoT-Cloud · GitHub

If you left click on

#include <MQTT.h>

and select go to definition does it take you to the header file? If not there may have been an issue when downloading the library.

1 Like

I had no idea you could do this! Great tip!

thanks jack it takes me here

image

Hi Theo,

It looks like you may have installed a different library package to the one used in the guide,
Within the repo that you found the code, there is a file containing all of the libraries used to make those examples.
i.e. your MQTT libraries folder should be esp-mqtt

Liam

1 Like