Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
using the semaphore.h header
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Portage & Programming
View previous topic :: View next topic  
Author Message
jeffw
n00b
n00b


Joined: 20 Feb 2003
Posts: 1

PostPosted: Thu Feb 20, 2003 5:42 am    Post subject: using the semaphore.h header Reply with quote

I'm trying to use the semaphore.h header in a C program, but am getting the following error from gcc when it tries to link:

/tmp/ccId5KG4.o(.text+0x2a): In function `main':
: undefined reference to `sem_init'
collect2: ld returned 1 exit status

Code:

#include <semaphore.h>

void main(void) {
    sem_t *s;
    sem_init( s, 0, 0 );     
}


The semaphore.h header exists in /usr/include/ and defines sem_init in exactly the way I'm using it. Every other standard C header I've tried to use works just fine. Any thoughts? Can anyone else get that to compile?
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Portage & Programming All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum