mqtt程序编译连接时缺少动态库
[email protected]:~/Desktop/yancheng/mqttClient$ g++ test123.cpp -o 123.o
/tmp/ccJj8ZcW.o: In function `main':
test123.cpp:(.text+0x1ea): undefined reference to `MQTTClient_create'
test123.cpp:(.text+0x217): undefined reference to `MQTTClient_connect'
test123.cpp:(.text+0x2ac): undefined reference to `MQTTClient_publishMessage'
test123.cpp:(.text+0x2ee): undefined reference to `MQTTClient_waitForCompletion'
test123.cpp:(.text+0x32e): undefined reference to `MQTTClient_disconnect'
test123.cpp:(.text+0x33d): undefined reference to `MQTTClient_destroy'
collect2: error: ld returned 1 exit status
解决方案:
https://www.jianshu.com/p/37f7ee7ead65
在ubuntu上安装MQTT