Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Cannot find alsa/asoundlib.h

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?

like image 986
Pulkit Gupta Avatar asked May 02 '11 23:05

Pulkit Gupta


2 Answers

If you're using debian or ubuntu then running apt-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.

like image 145
Software Mechanic Avatar answered Sep 23 '22 16:09

Software Mechanic


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.

like image 37
Peter Ju Avatar answered Sep 25 '22 16:09

Peter Ju