Resolving sem_* link errors on Linux
Hi,
I am having difficulty resolving this link errors with one of the file. Is there a particular library that I missed or need to include when using semaphore.h? Platform: Linux >>semtest.o: In function `main': >>semtest.o(.text+0x18): undefined reference to `sem_unlink' >>semtest.o(.text+0x69): undefined reference to `sem_open' >>semtest.o(.text+0x104): undefined reference to `sem_wait' >>semtest.o(.text+0x184): undefined reference to `sem_getvalue' >>semtest.o(.text+0x233): undefined reference to `sem_post' >>collect2: ld returned 1 exit status >>make: *** [semtest] Error 1 Any help would be appreciated. I am stuck at this point. Thanks, kl |
Maybe try to link it with libpthread (-lpthread)
grep sem_unlink /lib/libpthread-0.10.so -->Binary file /lib/libpthread-0.10.so matches |
I link with -lrt and it went away for now.
|
All times are GMT -5. The time now is 04:41 AM. |