我试图为Debian上安装的NXP(飞思卡尔) imx6开发一个"C“应用程序。我的主机是Ubuntu16.04。我正在使用eclipse作为IDE,直到今天我都可以跨编译。我使用arm-linux-gnueabihf-gcc作为编译器,使用arm-linux-gnueabihf-ld作为链接器。我在链接器参数中添加了-lasound选项,但仍然无法构建应用程序。我犯了个错误
arm-linux-gnueabihf-ld:找不到-lasound
我想我的Ubuntu (主机)机器上没有libasound.so文件,我的链接器无法链接到我的应用程序库。
我将libasound.so文件从ARM机器复制到我的主机到/home/user/Downloads文件夹,但仍然无法编译。
在构建之前,是否有步骤在交叉编译项目中使用ALSA库?
以下是构建操作的输出
Building target: tihc_linux_application
Invoking: GCC C Linker
/usr/bin/arm-linux-gnueabihf-ld -static -L/home/user/Downloads -pthread -lasound -o "main" ./src/main.o
/usr/bin/arm-linux-gnueabihf-ld: mode armelf_linux_eabi
/usr/bin/arm-linux-gnueabihf-ld: cannot find -lasound发布于 2017-01-26 10:11:51
您请求静态链接(通过-static),但提供共享库,因此ld可能会忽略它(以确保可以使用-Wl,--verbose运行)。一种选择是从头开始交叉编译libalsa,然后使用生成的静态lib链接您的应用程序。另一个选择是在某个地方搜索预编译的gnueabihf libalsa .
https://stackoverflow.com/questions/41870011
复制相似问题