Error Alsa/asoundlib.h No Such File
Contents |
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site
Undefined Reference To `snd_pcm_close'
About Us Learn more about Stack Overflow the company Business Learn more about undefined reference to `snd_pcm_open' hiring developers or posting ads with us Raspberry Pi Questions Tags Users Badges Unanswered Ask Question _ Raspberry Pi alsa asoundlib.h not found ubuntu Stack Exchange is a question and answer site for users and developers of hardware and software for Raspberry Pi. Join them; it only takes a minute: Sign up Here's how it works:
Undefined Reference To `snd_pcm_stream_name'
Anybody can ask a question Anybody can answer The best answers are voted up and rise to the top Sound recording program using Nano up vote 2 down vote favorite I want to make a sound recording program such as this on my RPI machine with several modifications. The problem is that I get the fatal error message "alsa/asoundlib.h : No such file or directory".
Install Libasound2-dev
I have Debian on my RPI /* This example reads from the default PCM device and writes to standard output for 5 seconds of data. */ /* Use the newer ALSA API */ #define ALSA_PCM_NEW_HW_PARAMS_API #include
reached that point where you copy code from a tutorial but it doesn't compile because your system is missing an include file. alsa-lib ubuntu And you don't have a clue of where to look for
Snd_pcm_hw_params_any
it, or maybe you have a clue but the package maintainers thought of a different naming for cannot find the package and it's very different from what you suspect it is. But lament no more, for I just found a nifty utility for Debian based systems such http://raspberrypi.stackexchange.com/questions/15018/sound-recording-program-using-nano as Ubuntu that is proving already very useful: apt-file. And I wonder how could I survive without it before. It's very simple to use: enter apt-file search the_missing_include.h in your favourite terminal session, and it will let you know which package(s) contain that cheeky .h. For example, I was trying to compile a basic sample snippet for https://soledadpenades.com/2009/01/06/what-package-does-this-file-belong-to/ testing ALSA, and it has an #include
libasound2-dev: /usr/include/alsa/asoundlib.h So that's it, asoundlib.h is in the package libasound2-dev. Of course, you can install apt-file with apt-get or with synaptic package manager, as you wish. This is apt-cool! 😀 If you're messing playing around with some code, you probably have reached that point where you copy code from a tutorial but it doesn't compile because your system is missing... Post navigation ← The ir
MCU Development Kits ARM Linux Development Boards Hackable Gadgets My Hardware How-Tos & Training Materials Embedded Linux Development Technical Glossary AllWinner How-tos http://www.cnx-software.com/2011/10/13/finding-the-package-that-contains-a-particular-file-in-ubuntu/ AMLogic How-tos Android How-tos Freescale i.MX How-tos Raspberry Pi How-tos Rockchip http://stackoverflow.com/questions/5863500/cannot-find-alsa-asoundlib-h How-tos Contact Us Home > Linux, Programming > Finding the package that contains a particular file in Ubuntu Finding the package that contains a particular file in Ubuntu October 13th, 2011 cnxsoft Leave a comment Go to comments Tweet It often happens that undefined reference a file is missing during compilation and you get this kind of error: In file included from media/audio/linux/audio_manager_linux.cc:15:0: ./media/audio/linux/alsa_input.h:8:28: fatal error: alsa/asoundlib.h: No such file or directory compilation terminated. In file included from media/audio/linux/alsa_input.cc:5:0: ./media/audio/linux/alsa_input.h:8:28: fatal error: alsa/asoundlib.h: No such file or directory compilation terminated. That usually means a development package is missing. Sometime you undefined reference to can just guess the name of the package or you can use aptitude to find the file. There is also another (better) method in Ubuntu: apt-file utility allows you to find the package corresponding to a particular file. First install apt-file sudo apt-get install apt-file Them the first time, you need to download the files with the data for your system apt-file update Finally, you can use apt-file to find the package. For example with alsa/asoundlib.h apt-file search alsa/asoundlib.h libasound2-dev: /usr/include/alsa/asoundlib.h Tweet It often happens that a file is missing during compilation and you get this kind of error: In file included from media/audio/linux/audio_manager_linux.cc:15:0: ./media/audio/linux/alsa_input.h:8:28: fatal error: alsa/asoundlib.h: No such file... Related posts: Redirect all output to a log file Finding a Missing Package in Ubuntu with Aptitude Cross-compiling Python for MIPS and ARM Platforms Unusual USB Devices in Linux Kernel Open a File Directly at the Requested Line with Vi Categories: Linux, Programming Tags: Linux, programming, ubuntu Comments (0) Trackbacks (0)
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site About Us Learn more about Stack Overflow the company Business Learn more about hiring developers or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 4.7 million programmers, just like you, helping each other. Join them; it only takes a minute: Sign up Cannot find alsa/asoundlib.h up vote 4 down vote favorite 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? android build alsa share|improve this question edited Jun 27 '11 at 14:16 Bill the Lizard 222k138447737 asked May 2 '11 at 23:16 Pulkit Gupta 7125 add a comment| 2 Answers 2 active oldest votes up vote 2 down vote 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. share|improve this answer answered Sep 2 '11 at 5:33 Peter Ju 212 add a comment| up vote 0 down vote 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 directory external/qemu/alsa as you and Peter Ju proposed. But after that another error occurred: 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. 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... share|improve this answer answered Jan 16 '12 at 18:47 codebold 916 add a comment| Your Answer draft saved draft discarded Sign up or log in Sign up using Google Sign up using Facebook Si