I got the example code from here. I have the header file MQTTClient.h as well.
MQTTClient.h
However when I build I get the errors:
undefined reference to M
It means paho library is not linked. In Linux for a c program example you can link paho library by this way:
c
gcc -L{complete path for output folder} {filename}.c -l paho-mqtt3c
In my case it looks like:
gcc -L/home/jaydev/MQTT/org.eclipse.paho.mqtt.c/build/output test2.c -lpaho-mqtt3c