Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum. |
Notices |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
 |
02-09-2009, 07:25 PM
|
#1
|
Member
Registered: May 2006
Location: Mt Umunhum, CA, USA, Earth
Distribution: Debian/ Fedora/ Ubuntu/ Raspbian
Posts: 549
Rep:
|
ALSA, link static, cannot find -lasound
hi group,
Trying to rebuild my ALSA programs with static libs.
Code:
Here is what works:
$ gcc -g -O2 -lasound -o volume volume.o
$ file volume
volume: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.9, not stripped
but when I try with -static, I get this:
Code:
gcc -g -O2 -static -lasound -o volume volume.o
/usr/local/lib/gcc/i686-pc-linux-gnu/4.3.2/../../../../i686-pc-linux-gnu/bin/ld: cannot find -lasound
Any ideas??
|
|
|
02-11-2009, 05:45 AM
|
#2
|
Senior Member
Registered: Apr 2004
Location: Potchefstroom, South Africa
Distribution: Fedora 17 - 3.3.4-5.fc17.x86_64
Posts: 1,552
Rep: 
|
Are you sure you have a file called
on your system?
If you do, is it in your PATH?
|
|
|
02-12-2009, 01:40 PM
|
#3
|
Member
Registered: May 2006
Location: Mt Umunhum, CA, USA, Earth
Distribution: Debian/ Fedora/ Ubuntu/ Raspbian
Posts: 549
Original Poster
Rep:
|
fixed that problem but found more
Quote:
Originally Posted by rylan76
Are you sure you have a file called
on your system?
If you do, is it in your PATH?
|
I nade the static libraries for ALSA but then found more problems.
Had to add lpthread and -ldl. That caused a warning that I could not clear up.
Code:
gcc -g -O2 -static -lasound -lpthread -ldl -o vmsrec vmsrec.o args.o file.o help.o audio.o S-2-A.o console.o comport.o
vmsrec.o: In function `Quit':
/src/VMS/v1.1/src/record/vmsrec.c:293: undefined reference to `snd_pcm_drop'
/src/VMS/v1.1/src/record/vmsrec.c:294: undefined reference to `snd_pcm_close'
vmsrec.o: In function `main':
/src/VMS/v1.1/src/record/vmsrec.c:165: undefined reference to `snd_pcm_readi'
audio.o: In function `Close_Audio':
/src/VMS/v1.1/src/record/audio.c:87: undefined reference to `snd_pcm_close'
audio.o: In function `Open_Audio':
/src/VMS/v1.1/src/record/audio.c:21: undefined reference to `snd_pcm_open'
/src/VMS/v1.1/src/record/audio.c:26: undefined reference to `snd_pcm_poll_descriptors_count'
/src/VMS/v1.1/src/record/audio.c:34: undefined reference to `snd_pcm_poll_descriptors'
/src/VMS/v1.1/src/record/audio.c:42: undefined reference to `snd_pcm_hw_params_sizeof'
/src/VMS/v1.1/src/record/audio.c:42: undefined reference to `snd_pcm_hw_params_sizeof'
/src/VMS/v1.1/src/record/audio.c:43: undefined reference to `snd_pcm_hw_params_any'
/src/VMS/v1.1/src/record/audio.c:45: undefined reference to `snd_pcm_hw_params_set_access'
/src/VMS/v1.1/src/record/audio.c:46: undefined reference to `snd_pcm_hw_params_set_channels'
/src/VMS/v1.1/src/record/audio.c:47: undefined reference to `snd_pcm_hw_params_set_format'
/src/VMS/v1.1/src/record/audio.c:48: undefined reference to `snd_pcm_hw_params_set_rate_near'
/src/VMS/v1.1/src/record/audio.c:50: undefined reference to `snd_pcm_hw_params'
/src/VMS/v1.1/src/record/audio.c:53: undefined reference to `snd_pcm_start'
collect2: ld returned 1 exit status
make: *** [vmsrec] Error 1
$ sudo locate libasound.a
/src/ALSA/alsa-lib-1.0.9rc4/src/.libs/libasound.a
/usr/lib/libasound.a
And to answer your question, I'm running FC8 with alsa-lib-1.0.9rc4.
|
|
|
02-13-2009, 07:39 AM
|
#4
|
Senior Member
Registered: Apr 2004
Location: Potchefstroom, South Africa
Distribution: Fedora 17 - 3.3.4-5.fc17.x86_64
Posts: 1,552
Rep: 
|
[QUOTE=MrUmunhum;3441347]I nade the static libraries for ALSA but then found more problems.
Had to add lpthread and -ldl. That caused a warning that I could not clear up.
Code:
gcc -g -O2 -static -lasound -lpthread -ldl -o vmsrec vmsrec.o args.o file.o help.o audio.o S-2-A.o console.o comport.o
vmsrec.o: In function `Quit':
/src/VMS/v1.1/src/record/vmsrec.c:293: undefined reference to `snd_pcm_drop'
/src/VMS/v1.1/src/record/vmsrec.c:294: undefined reference to `snd_pcm_close'
vmsrec.o: In function `main':
/src/VMS/v1.1/src/record/vmsrec.c:165: undefined reference to `snd_pcm_readi'
audio.o: In function `Close_Audio':
/src/VMS/v1.1/src/record/audio.c:87: undefined reference to `snd_pcm_close'
audio.o: In function `Open_Audio':
/src/VMS/v1.1/src/record/audio.c:21: undefined reference to `snd_pcm_open'
/src/VMS/v1.1/src/record/audio.c:26: undefined reference to `snd_pcm_poll_descriptors_count'
/src/VMS/v1.1/src/record/audio.c:34: undefined reference to `snd_pcm_poll_descriptors'
/src/VMS/v1.1/src/record/audio.c:42: undefined reference to `snd_pcm_hw_params_sizeof'
/src/VMS/v1.1/src/record/audio.c:42: undefined reference to `snd_pcm_hw_params_sizeof'
/src/VMS/v1.1/src/record/audio.c:43: undefined reference to `snd_pcm_hw_params_any'
/src/VMS/v1.1/src/record/audio.c:45: undefined reference to `snd_pcm_hw_params_set_access'
/src/VMS/v1.1/src/record/audio.c:46: undefined reference to `snd_pcm_hw_params_set_channels'
/src/VMS/v1.1/src/record/audio.c:47: undefined reference to `snd_pcm_hw_params_set_format'
/src/VMS/v1.1/src/record/audio.c:48: undefined reference to `snd_pcm_hw_params_set_rate_near'
/src/VMS/v1.1/src/record/audio.c:50: undefined reference to `snd_pcm_hw_params'
/src/VMS/v1.1/src/record/audio.c:53: undefined reference to `snd_pcm_start'
collect2: ld returned 1 exit status
make: *** [vmsrec] Error 1
Yikes, not sure what is going on there... what this means (at least, some more knowledgable guys said so when I got the same types of errors) is that "you have an older or incompatible library version".
I. e. the vmsrec.c and audo.c files, refer to symbols that are not present in the libraries you have listed when you try to compile the program (from there the complaints about "undefined references".
I don't see how adding -lpthread -ldl (whatever "dl" is) can cause these.... Most likely you'll need to get a newer ALSA lib, if one exits, and try compiling against that?
Hope this helped...
|
|
|
All times are GMT -5. The time now is 06:12 PM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|