13

在构建我的 Android 源代码时出现此错误

找不到 alsa/asoundlib.h

我已经安装了 libasound2-dev。asoundlib.h 存在于 usr/include/alsa/ 文件夹中,但构建器仍然无法找到它。

谁能告诉我为什么编译器找不到asoundlib.h?如何将 /usr/include 添加到头文件的搜索路径中?

4

3 回答 3

23

如果您正在使用debianubuntu然后运行apt-get install libasound2-dev可以解决问题。它会安装所需的头文件,但您可能会遇到某些版本不兼容的问题。(在这种情况下,解决方案是回到源头并找到它。)

此外,软件包名称会因操作系统版本而异。通常,如果安装了开发库,您应该能够通过运行locate asoundlib.h命令找到它。

于 2019-04-09T07:58:43.560 回答
2

I had the problem then I found the solution. In external/alsa-lib include they have all the libraries for the alsa-util compiles. However the alsa-util compiles or other alsa related programs are looking for alsa/*.h libraries where as all the *.h are in the include folder.

Create an alsa folder within the external/alsa-lib/include/ then copy all needed libraries should solve the problem.

于 2011-09-02T05:33:38.193 回答
0

您是否从 Subversion 存储库获取源代码?

我有同样的问题,因为我从一个非官方的 Subversion 存储库中检查了源代码。所以我首先按照你和 Peter Ju 的建议安装libasound2-dev并复制目录/usr/include/alsa到目录中。external/qemu/alsa但在那之后又出现了一个错误:

make: *** No rule to make target 'prebuilt/linux-x86/sdl/lib/libSDL.a', needed by 'out/host/linux-x86/obj/STATIC_LIBRARIES/libSDL_intermediates/libSDL.a'.  Stop.

经过一番研究,我发现prebuilt文件夹中的一些静态库丢失了,因为Subversion 忽略了一些特定的文件扩展名。获得这些文件后,一切正常...

不知道这是否会在您的情况下发挥作用,但也许它是您或其他人的“缺失链接”......

于 2012-01-16T18:47:30.617 回答