找不到 alsa/asoundlib.h
在构建 Android 源代码时出现此错误
找不到 alsa/asoundlib.h
我已经安装了 libasound2-dev。 asoundlib.h 存在于 usr/include/alsa/ 文件夹中 但建造者仍然找不到它。
谁能告诉我为什么编译器找不到asoundlib.h? 如何将/usr/include添加到头文件的搜索路径中?
While building my Android source code I get this error
cannot find alsa/asoundlib.h
I have already installed libasound2-dev. asoundlib.h is present in usr/include/alsa/ folder
but still the builder is not able to find it.
Can anyone tell me that why the compiler is not able to find asoundlib.h?
How to add /usr/include to the search path for header files?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
如果您使用的是
debian
或ubuntu
,则运行apt-get install libasound2-dev
即可解决该问题。它会安装所需的头文件,但您可能会遇到某些版本不兼容的情况。 (在这种情况下,解决方案是返回源并找到它。)此外,软件包名称会因操作系统版本的不同而有所不同。
一般来说,如果安装了开发库,您应该能够通过运行
locate asoundlib.h
命令找到它。If you're using
debian
orubuntu
then runningapt-get install libasound2-dev
solves the problem. It installs the needed header files, though you might run into some version incompatibilities. (In which case, the solution is to go back to source and find it.)Additionally, the package names would vary for different OS versions.
In generally if the development libraries are installed you should be able to find it by running
locate asoundlib.h
command.我遇到了问题,然后我找到了解决方案。
在 external/alsa-lib include 中,它们拥有用于 alsa-util 编译的所有库。然而,alsa-util 编译或其他 alsa 相关程序正在寻找 alsa/*.h 库,其中所有 *.h 都在包含文件夹中。
在 external/alsa-lib/include/ 中创建一个 alsa 文件夹,然后复制所有需要的库应该可以解决问题。
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.
您是否从 Subversion 存储库获取源代码?
当我从非官方 Subversion 存储库查看源代码时,我遇到了同样的问题。所以我首先安装了libasound2-dev,并将目录/usr/include/alsa复制到目录external/qemu/alsa,就像你和Peter一样鞠提议道。但之后又发生了另一个错误:
经过一番研究,我发现
prebuilt
文件夹中的一些静态库丢失了,因为 Subversion 会忽略某些特定的文件扩展名。获得这些文件后,一切正常...不知道这是否会在您的情况下起作用,但也许这对您或其他人来说是“缺失的链接”...
Did you get your source code from a Subversion repository?
I had the same issue, as i checked out the source code from an unofficial Subversion repository. So I first installed
libasound2-dev
and copied the directory/usr/include/alsa
to the directoryexternal/qemu/alsa
as you and Peter Ju proposed. But after that another error occurred:After some research I found out that some static libraries in the
prebuilt
folder were missing, because Subversion ignores some specific file extensions. After getting these files, everything worked well...Don't know if this will do trick in your case but maybe it is the 'missing link' for you or someone else...