jeffw n00b
Joined: 20 Feb 2003 Posts: 1
|
Posted: Thu Feb 20, 2003 5:42 am Post subject: using the semaphore.h header |
|
|
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? |
|