* Unresolved reference: sem_wait
@ 2000-04-12 4:00 Ali Berrached
2000-04-13 4:00 ` Joe Mario
2000-04-13 4:00 ` Hans Schwengeler
0 siblings, 2 replies; 3+ messages in thread
From: Ali Berrached @ 2000-04-12 4:00 UTC (permalink / raw)
I am trying to use semaphores for thread synchronization (using sem_init,
sem_wait, sem_post, etc.) on Digital Unix 4. But the cc compiler keeps
generating the error message "unresolved reference: sem_wait, sem_post,
...). I have included <semaphore.h> and compiled using the -pthread option
(cc prog.c -pthread). It seems like I need to link to some library but
there is no mention of it in the documentation. Anyone else ran into this
problem before? any help will be greatly appreciated.
Many Thanks
Ali Berrached
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: Unresolved reference: sem_wait
2000-04-12 4:00 Unresolved reference: sem_wait Ali Berrached
@ 2000-04-13 4:00 ` Joe Mario
2000-04-13 4:00 ` Hans Schwengeler
1 sibling, 0 replies; 3+ messages in thread
From: Joe Mario @ 2000-04-13 4:00 UTC (permalink / raw)
Ali Berrached wrote:
> I am trying to use semaphores for thread synchronization (using sem_init,
> sem_wait, sem_post, etc.) on Digital Unix 4. But the cc compiler keeps
> generating the error message "unresolved reference: sem_wait, sem_post,
> ...). I have included <semaphore.h> and compiled using the -pthread option
> (cc prog.c -pthread). It seems like I need to link to some library but
> there is no mention of it in the documentation. Anyone else ran into this
> problem before? any help will be greatly appreciated.
The symbols your link is missing are defined in /usr/shlib/librt.so. If you
link with -lrt, you should be all set.
% nm /usr/shlib/librt.so |grep sem_
psx4_csem_sleep_wakeup | 0004395913552688 | T | 0000000000000008
psx4_sem_sleep | 0004395913552640 | T | 0000000000000008
psx4_sem_wakeup | 0004395913552592 | T | 0000000000000008
sem_close | 0004395913538400 | T |
0000000000000008
sem_destroy | 0004395913536432 | T |
0000000000000008
sem_getvalue | 0004395913536176 | T |
0000000000000008
sem_init | 0004395913535568 | T |
0000000000000008
sem_open | 0004395913537392 | T |
0000000000000008
sem_post | 0004395913539984 | T |
0000000000000008
sem_trywait | 0004395913539248 | T |
0000000000000008
sem_unlink | 0004395913538720 | T |
0000000000000008
sem_wait | 0004395913539568 | T |
0000000000000008
Joe
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: Unresolved reference: sem_wait
2000-04-12 4:00 Unresolved reference: sem_wait Ali Berrached
2000-04-13 4:00 ` Joe Mario
@ 2000-04-13 4:00 ` Hans Schwengeler
1 sibling, 0 replies; 3+ messages in thread
From: Hans Schwengeler @ 2000-04-13 4:00 UTC (permalink / raw)
In article <8d3inv$it1$1@masala.cc.uh.edu>,
"Ali Berrached" <BerrachedA@dt.uh.edu> writes:
> I am trying to use semaphores for thread synchronization (using sem_init,
> sem_wait, sem_post, etc.) on Digital Unix 4. But the cc compiler keeps
> generating the error message "unresolved reference: sem_wait, sem_post,
> ...). I have included <semaphore.h> and compiled using the -pthread option
> (cc prog.c -pthread). It seems like I need to link to some library but
> there is no mention of it in the documentation. Anyone else ran into this
> problem before? any help will be greatly appreciated.
>
> Many Thanks
> Ali Berrached
>
Dear Ali,
grep -l sem_wait /usr/lib/* shows:
/usr/lib/librt.a
Yours, Hans.
===============================================================================
Hans Schwengeler
Astronomical Institute INTERNET: schweng@astro.unibas.ch
University of Basel Hans.Schwengeler@unibas.ch
Venusstrasse 7
CH-4102 Binningen PHONE: +41 61 20 55 422
Switzerland FAX: +41 61 20 55 455
===============================================================================
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2000-04-13 4:00 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2000-04-12 4:00 Unresolved reference: sem_wait Ali Berrached
2000-04-13 4:00 ` Joe Mario
2000-04-13 4:00 ` Hans Schwengeler
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox