【发布时间】:2017-01-26 18:11:51
【问题描述】:
我正在尝试为我的 NXP(Freescale) imx6 制作一个安装了 Debian OS 的“C”应用程序。我的主机是 Ubuntu 16.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
【问题讨论】: