This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

sample application for Paho-Mqtt

Hello,

I am trying to cross compile a sample application for Paho-Mqtt found on the bottom of this page:

?

1

1. I have the paho-mqtt-c recipe built in my rootfs as it was part of the provided meta-oe layer and I had to simple add it to IMAGE_INSTALL_append.

2. I also have it installed on my host machine using apt-get and can compile using

?

1

gcc test.c -l paho-mqtt3c

3. I even sourced the environment_setup script and tried compiling :

?

1

2

3

4

5

[linux-devkit]:~/work/mqtt-code> aarch64-linux-gnu-gcc -l paho-mqtt3c mqtt-test.c

mqtt-test.c:4:10: fatal error: MQTTClient.h: No such file or directory

#include "MQTTClient.h"

         ^~~~~~~~~~~~~~

compilation terminated.

4. How do I make the cross compiler see the correct library?

Thank

  • Hello, 

    user5078703 said:
    3. I even sourced the environment_setup script and tried compiling :

    Ensure that the MQTTClient.h file exist within your project structure.
    It looks like you need to correct the environment_setup script to provide a path to MQTTClient.h.