quiniouben / vban

VBAN protocol open-source implementation
GNU General Public License v3.0
450 stars 63 forks source link

asoundlib.h not found while make on armv7l #1

Closed ghost closed 8 years ago

ghost commented 8 years ago

error during make

# make
Compiling main.c
In file included from main.c:25:0:
audio.h:23:28: fatal error: alsa/asoundlib.h: No such file or directory
compilation terminated.

asoundlib.h is installed on the system

# locate asoundlib
/usr/include/dssi/alsa/asoundlib.h

is there a way to configure lib path?

ghost commented 8 years ago

missing library has been resolved by installing libasound2-dev but make still fails:

make
Compiling main.c
Compiling socket.c
Compiling audio.c
audio.c: In function ‘audio_write’:
audio.c:327:16: warning: format ‘%lu’ expects argument of type ‘long unsigned int’, but argument 2 has type ‘size_t {aka unsigned int}’ [-Wformat=]
         printf("audio_write: short write (expected %lu, wrote %i)\n", size, ret);
                ^
Linking vban_receptor
audio.o: In function `audio_open':
audio.c:(.text+0x326): undefined reference to `snd_pcm_open'
audio.c:(.text+0x334): undefined reference to `snd_strerror'
audio.c:(.text+0x38a): undefined reference to `snd_pcm_set_params'
audio.c:(.text+0x398): undefined reference to `snd_strerror'
audio.c:(.text+0x3bc): undefined reference to `snd_pcm_prepare'
audio.c:(.text+0x3ca): undefined reference to `snd_strerror'
audio.o: In function `audio_close':
audio.c:(.text+0x43a): undefined reference to `snd_pcm_close'
audio.o: In function `audio_write':
audio.c:(.text+0x4a2): undefined reference to `snd_pcm_writei'
audio.c:(.text+0x4b0): undefined reference to `snd_strerror'
audio.c:(.text+0x4ce): undefined reference to `snd_pcm_recover'
audio.c:(.text+0x4dc): undefined reference to `snd_strerror'
collect2: error: ld returned 1 exit status
Makefile:31: recipe for target 'vban_receptor' failed
make: *** [vban_receptor] Error 1
quiniouben commented 8 years ago

Sorry for delay in my answer and first, sorry that you face the current lack of configure script. About headers you found by yourself, I will add some explicit documentation about the need for these headers. About link error, well, the standard solution is that I write a configure script. I can also probably do an alternative with a makefile target that would invoke pkg-config, it should be enough. Let me experiment around these and fix my project.

quiniouben commented 8 years ago

Hello, I implemented autotools build scripts that should handle headers and libraries pathes. Please let me know if you still have troubles. If everything works fine from now, you or I can close this issue. thanx for your feedback so far.

ghost commented 8 years ago

Hi, it works perfect thank you