# Compiler Error

**URL:** <https://forum.core-electronics.com.au/t/compiler-error/20099>\
**Category:** Support\
**Created:** [31 May 2024 04:17 UTC](https://forum.core-electronics.com.au/t/compiler-error/20099 "2024-05-31T04:17:38Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![Theo272603](https://avatars.discourse-cdn.com/v4/letter/t/ecccb3/32.png) [@Theo272603](https://forum.core-electronics.com.au/u/Theo272603)\
**Post date:** [31 May 2024 04:17 UTC](https://forum.core-electronics.com.au/t/compiler-error/20099/1 "2024-05-31T04:17:38Z")

</div>

Hi All,

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

 ![image](https://canada1.discourse-cdn.com/flex028/uploads/core_electronics/original/2X/b/bf237774e1faa9315a72e02c1dc36899248dc2ee.png)

I have been [following this guide](https://www.instructables.com/ESP8266-5-internet-controlled-switch/). Any ideas?

---

<div class="post-metadata">

**Author:** ![Pixmusix](https://yyz2.discourse-cdn.com/flex028/user_avatar/forum.core-electronics.com.au/pixmusix/32/9719_2.png) [@Pixmusix](https://forum.core-electronics.com.au/u/Pixmusix)\
**Post date:** [31 May 2024 04:47 UTC](https://forum.core-electronics.com.au/t/compiler-error/20099/2 "2024-05-31T04:47:35Z")

</div>

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?

> **[EasyIoT-Cloud/libraries/esp-mqtt at master · iot-playground/EasyIoT-Cloud](https://github.com/iot-playground/EasyIoT-Cloud/tree/master/libraries/esp-mqtt)**
>
> EasyIoT Cloud source code examples and libraries. More at http://cloud.iot-playground.com/ - iot-playground/EasyIoT-Cloud

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

---

<div class="post-metadata">

**Author:** ![Jack](https://yyz2.discourse-cdn.com/flex028/user_avatar/forum.core-electronics.com.au/jack/32/9287_2.png) [@Jack](https://forum.core-electronics.com.au/u/Jack)\
**Post date:** [31 May 2024 05:04 UTC](https://forum.core-electronics.com.au/t/compiler-error/20099/3 "2024-05-31T05:04:53Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![Theo272603](https://avatars.discourse-cdn.com/v4/letter/t/ecccb3/32.png) [@Theo272603](https://forum.core-electronics.com.au/u/Theo272603)\
**Post date:** [31 May 2024 05:19 UTC](https://forum.core-electronics.com.au/t/compiler-error/20099/4 "2024-05-31T05:19:30Z")

</div>

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

 ![image](https://canada1.discourse-cdn.com/flex028/uploads/core_electronics/original/2X/0/0b01dfa10b03b8a2f2bee51d00ec821df5b5a97f.png)

---

<div class="post-metadata">

**Author:** ![Theo272603](https://avatars.discourse-cdn.com/v4/letter/t/ecccb3/32.png) [@Theo272603](https://forum.core-electronics.com.au/u/Theo272603)\
**Post date:** [31 May 2024 05:21 UTC](https://forum.core-electronics.com.au/t/compiler-error/20099/5 "2024-05-31T05:21:59Z")

</div>

code was downloaded from here

[EasyIoT-Cloud/esp8266\_mqtt\_switch1/esp8266\_mqtt\_switch1.ino at master · iot-playground/EasyIoT-Cloud · GitHub](https://github.com/iot-playground/EasyIoT-Cloud/blob/master/esp8266_mqtt_switch1/esp8266_mqtt_switch1.ino)

---

<div class="post-metadata">

**Author:** ![Jack](https://yyz2.discourse-cdn.com/flex028/user_avatar/forum.core-electronics.com.au/jack/32/9287_2.png) [@Jack](https://forum.core-electronics.com.au/u/Jack)\
**Post date:** [31 May 2024 05:53 UTC](https://forum.core-electronics.com.au/t/compiler-error/20099/6 "2024-05-31T05:53:05Z")

</div>

If you left click on

```auto
#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.

---

<div class="post-metadata">

**Author:** ![Pixmusix](https://yyz2.discourse-cdn.com/flex028/user_avatar/forum.core-electronics.com.au/pixmusix/32/9719_2.png) [@Pixmusix](https://forum.core-electronics.com.au/u/Pixmusix)\
**Post date:** [31 May 2024 06:38 UTC](https://forum.core-electronics.com.au/t/compiler-error/20099/7 "2024-05-31T06:38:01Z")

</div>

> [@Jack](#):
>
> select go to definition

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

---

<div class="post-metadata">

**Author:** ![Theo272603](https://avatars.discourse-cdn.com/v4/letter/t/ecccb3/32.png) [@Theo272603](https://forum.core-electronics.com.au/u/Theo272603)\
**Post date:** [31 May 2024 06:48 UTC](https://forum.core-electronics.com.au/t/compiler-error/20099/8 "2024-05-31T06:48:05Z")

</div>

thanks jack it takes me here

![image](https://canada1.discourse-cdn.com/flex028/uploads/core_electronics/original/2X/b/b902c76bf57b10c1ed56aca39d12b4853966b0a0.png)

---

<div class="post-metadata">

**Author:** ![Liam](https://yyz2.discourse-cdn.com/flex028/user_avatar/forum.core-electronics.com.au/liam/32/3562_2.png) [@Liam](https://forum.core-electronics.com.au/u/Liam)\
**Post date:** [31 May 2024 06:54 UTC](https://forum.core-electronics.com.au/t/compiler-error/20099/9 "2024-05-31T06:54:10Z")

</div>

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
