如何为i.MX6平台交叉编译和链接mosquitto库?

时间:2019-08-07 21:13:29

标签: c++ mqtt

我需要在C ++中为NXP的i.MX6平台实现MQTT客户端。 我能够在Ubuntu LTS 18.04上编译并链接客户端。首先,我安装了mosquitto库:

sudo apt install libmosquitto-dev

然后,我编译并链接:

g++ app.cpp -I/usr/include -lmosquittopp -o app

我测试了客户。很好。

因此,现在的问题是:如何为i.MX6平台交叉编译和链接?我尝试编译它,但出现错误:

Linking /home/user1/app/mqttClient...
"arm-linux-gnueabihf-gcc"  -g -D_REENTRANT ... -lstdc++ -lpthread -ldl -lmosquittopp
/usr/lib/gcc-cross/arm-linux-gnueabihf/7/../../../../arm-linux-gnueabihf/bin/ld: cannot find -lmosquittopp

找不到链接的原因是“ mosquittopp”。有没有一种方法可以为i.MX6平台安装mosquitto库?还是有办法从源代码为i.MX6平台构建mosquitto库?

谢谢!

0 个答案:

没有答案
相关问题