I was trying to compile a program statically, and it required libasound. When I tried to compile it I got the following errors:
g++ -I/usr/sness/marsyas-debug/include/marsyas -g -static -I/usr/sness/include -c -o mirex_extract.o mirex_extract.cpp
g++ -g -static -I/usr/sness/include -o mirex_extract mirex_extract.o /usr/sness/marsyas-debug/lib/libmarsyas.a -L/usr/snes\
s/lib -lpthread -lasound -lmad
/usr/sness/lib/libasound.a(dlmisc.o): In function `snd_dlsym_verify':
/home/sness/down/alsa-lib-1.0.17a/src/dlmisc.c:115: undefined reference to `dlsym'
/usr/sness/lib/libasound.a(dlmisc.o): In function `snd_dlsym':
/home/sness/down/alsa-lib-1.0.17a/src/dlmisc.c:161: undefined reference to `dlsym'
/usr/sness/lib/libasound.a(dlmisc.o): In function `snd_dlclose':
/home/sness/down/alsa-lib-1.0.17a/src/dlmisc.c:85: undefined reference to `dlclose'
/usr/sness/lib/libasound.a(dlmisc.o): In function `snd_dlopen':
/home/sness/down/alsa-lib-1.0.17a/src/dlmisc.c:64: undefined reference to `dlopen'
collect2: ld returned 1 exit status
make: *** [mirex_extract] Error 1
Turns out I just needed to add -ldl to your LDFLAGS like this:
LIBS = -L/usr/sness/lib -lpthread -lasound -lmad -ldl
g++ -g -static -I/usr/sness/include -o mirex_extract mirex_extract.o /usr/sness/marsyas-debug/lib/libmarsyas.a -L/usr/sness/lib -lpthread -lasound -lmad -ldl