From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: fee84,e78de1fab6a088d0 X-Google-Attributes: gidfee84,public From: Joe Mario Subject: Re: Unresolved reference: sem_wait Date: 2000/04/13 Message-ID: <38F60085.51BFC254@zk3.dec.com>#1/1 X-Deja-AN: 610988810 Content-Transfer-Encoding: 7bit References: <8d3inv$it1$1@Masala.CC.UH.EDU> X-Accept-Language: en Content-Type: text/plain; charset=us-ascii X-Complaints-To: iass@lead.zk3.dec.com X-Trace: lead.zk3.dec.com 955645886 19332 16.141.0.18 (13 Apr 2000 17:11:26 GMT) Mime-Version: 1.0 NNTP-Posting-Date: 13 Apr 2000 17:11:26 GMT Newsgroups: comp.unix.osf.osf1 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 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