[alsa-devel] alsa/asoundlib.h file not found
Hi,
I have integrated the codec driver and the kernel log shows the sound card is detected. now i want to test the codec. i tried the sample test code for capture and playback.
i am getting a compilation errors due to the asoundlib.h. please find the error log for my application.
main.c:2:23: error: asoundlib.h: No such file or directory main.c: In function 'main': main.c:7: error: 'snd_pcm_t' undeclared (first use in this function) main.c:7: error: (Each undeclared identifier is reported only once main.c:7: error: for each function it appears in.) main.c:7: error: 'pcm_handle' undeclared (first use in this function) main.c:10: error: 'snd_pcm_stream_t' undeclared (first use in this function) main.c:10: error: expected ';' before 'stream' main.c:15: error: 'snd_pcm_hw_params_t' undeclared (first use in this function) main.c:15: error: 'hwparams' undeclared (first use in this function) main.c:22: warning: 'return' with a value, in function returning void main.c:34: error: 'snd_pcm_uframes_t' undeclared (first use in this function) main.c:34: error: expected ';' before 'periodsize' main.c:46: error: 'SND_PCM_ACCESS_RW_INTERLEAVED' undeclared (first use in this function) main.c:48: warning: 'return' with a value, in function returning void main.c:52: error: 'SND_PCM_FORMAT_S16_LE' undeclared (first use in this function) main.c:54: warning: 'return' with a value, in function returning void main.c:62: warning: 'return' with a value, in function returning void main.c:65:19: warning: missing terminating " character main.c:65: error: missing terminating " character main.c:66: error: expected expression before '==' token main.c:66: error: stray '' in program main.c:66:31: warning: missing terminating " character main.c:66: error: missing terminating " character main.c:67: error: expected ';' before '}' token main.c:72: warning: 'return' with a value, in function returning void main.c:78: warning: 'return' with a value, in function returning void main.c:86: error: 'periodsize' undeclared (first use in this function) main.c:88: warning: 'return' with a value, in function returning void main.c:99: warning: 'return' with a value, in function returning void main.c:112: warning: incompatible implicit declaration of built-in function 'malloc' main.c:115: error: 'num_frames' undeclared (first use in this function) main.c:5: warning: return type of 'main' is not 'int'
please suggest what needs to be done to resolve this issue asap.
Thank you, Sreedhar.
On Tue, Sep 6, 2011 at 5:33 AM, Clemens Ladisch clemens@ladisch.de wrote:
Appalayagari Sreedhar wrote:
main.c:2:23: error: asoundlib.h: No such file or directory
This means that alsa-lib is not installed correctly.
On Debian/Ubuntu, install a package called libasound2-dev On SuSe, you can probably `zypper install -C 'pkgconfig(alsa)'` (I think the -C is correct... for "capabilities") On Fedora, it's `yum install 'pkgconfig(alsa)'`
-gabriel
Gabriel Beddingfield <gabrbedd <at> gmail.com> writes:
On Tue, Sep 6, 2011 at 5:33 AM, Clemens Ladisch <clemens <at> ladisch.de>
wrote:
Appalayagari Sreedhar wrote:
main.c:2:23: error: asoundlib.h: No such file or directory
This means that alsa-lib is not installed correctly.
On Debian/Ubuntu, install a package called libasound2-dev On SuSe, you can probably `zypper install -C 'pkgconfig(alsa)'` (I think the -C is correct... for "capabilities") On Fedora, it's `yum install 'pkgconfig(alsa)'`
-gabriel
I am still getting the problem even though alsa-lib-devel is installed on my fedora 14.
On 12/04/2013 10:38 AM, Max wrote:
Gabriel Beddingfield <gabrbedd <at> gmail.com> writes:
On Tue, Sep 6, 2011 at 5:33 AM, Clemens Ladisch <clemens <at> ladisch.de>
wrote:
Appalayagari Sreedhar wrote:
main.c:2:23: error: asoundlib.h: No such file or directory
This means that alsa-lib is not installed correctly.
On Debian/Ubuntu, install a package called libasound2-dev On SuSe, you can probably `zypper install -C 'pkgconfig(alsa)'` (I think the -C is correct... for "capabilities") On Fedora, it's `yum install 'pkgconfig(alsa)'`
I am still getting the problem even though alsa-lib-devel is installed on my fedora 14.
On Fedora 19 I get:
$ pkg-config --cflags alsa -I/usr/include/alsa
So:
1. Make sure that /usr/include/alsa/asoundlib.h exists 2. Make sure that you add "-I/usr/include/alsa" to your CFLAGS
-gabe
participants (5)
-
Appalayagari Sreedhar
-
Clemens Ladisch
-
Gabriel Beddingfield
-
Gabriel M. Beddingfield
-
Max