LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 04-05-2005, 05:35 PM   #1
ceoping
LQ Newbie
 
Registered: Apr 2005
Posts: 6

Rep: Reputation: 0
Question Resolving sem_* link errors on Linux


Hi,

I am having difficulty resolving this link errors with one of the file. Is there a particular library that I missed or need to include when using semaphore.h?

Platform: Linux

>>semtest.o: In function `main':
>>semtest.o(.text+0x18): undefined reference to `sem_unlink'
>>semtest.o(.text+0x69): undefined reference to `sem_open'
>>semtest.o(.text+0x104): undefined reference to `sem_wait'
>>semtest.o(.text+0x184): undefined reference to `sem_getvalue'
>>semtest.o(.text+0x233): undefined reference to `sem_post'
>>collect2: ld returned 1 exit status
>>make: *** [semtest] Error 1

Any help would be appreciated. I am stuck at this point.

Thanks,

kl
 
Old 04-06-2005, 10:02 AM   #2
keefaz
LQ Guru
 
Registered: Mar 2004
Distribution: Slackware
Posts: 6,552

Rep: Reputation: 872Reputation: 872Reputation: 872Reputation: 872Reputation: 872Reputation: 872Reputation: 872
Maybe try to link it with libpthread (-lpthread)

grep sem_unlink /lib/libpthread-0.10.so
-->Binary file /lib/libpthread-0.10.so matches
 
Old 04-07-2005, 11:32 AM   #3
ceoping
LQ Newbie
 
Registered: Apr 2005
Posts: 6

Original Poster
Rep: Reputation: 0
I link with -lrt and it went away for now.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
troube installing hydrogen - need direction on resolving errors tw001_tw Slackware 4 07-12-2004 11:36 AM
rpm --verify net-tools gives pre link errors abefroman Fedora - Installation 0 04-11-2004 10:42 AM
/etc/hosts resolving before DNS resolving ? markraem Linux - Networking 4 11-02-2003 04:54 AM
D-Link driver compile -> billions of errors Wynd Linux - Hardware 1 07-18-2003 03:24 AM
Link errors from gcc CraigN Programming 2 02-27-2003 07:43 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 04:07 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration