为了在我的ubuntu桌面上运行蓝牙C程序,我使用以下命令安装了libbluetooth-dev
sudo apt-get install libbluetooth-dev然后我用以下命令编译代码
gcc -o simplescan simplescan.c -lbluetooth它执行得很好。但是,当我尝试为Android交叉编译它时,使用
arm-linux-gnueabi-gcc -o simplescan simplescan.c -lbluetooth它给了我这个错误
/usr/lib/gcc-cross/arm-linux-gnueabi/4.7/../../../../arm-linux-gnueabi/bin/ld: cannot find -lbluetooth
collect2: error: ld returned 1 exit status我注意到这里也有类似的帖子:Bluetooth programming in Linux - cross compiler issue
但是它似乎没有给出解决方案,我仍然对如何安装交叉编译器的libbluetooth-dev支持感到困惑。
发布于 2020-04-18 22:02:20
您不能链接为不同架构编译的libbluetooth库。您需要为将为其构建应用程序的体系结构构建libbluetooth库。
https://stackoverflow.com/questions/43037007
复制相似问题