From: Joe Mario <mario@zk3.dec.com>
Subject: Re: Unresolved reference: sem_wait
Date: 2000/04/13 [thread overview]
Message-ID: <38F60085.51BFC254@zk3.dec.com> (raw)
In-Reply-To: 8d3inv$it1$1@Masala.CC.UH.EDU
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
prev parent reply other threads:[~2000-04-13 4:00 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2000-04-12 4:00 Unresolved reference: sem_wait Ali Berrached
2000-04-13 4:00 ` Hans Schwengeler
2000-04-13 4:00 ` Joe Mario [this message]
read-only archive
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox