Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Undefined reference to symbol 'sem_post@@GLIBC_2.4

Tags:

c

eclipse

linker

I am trying to build a sample code using Eclipse and ARM Sourcery Windows GCC C on Windows 8 machine. When I compile code : I get this error :

Undefined reference to symbol 'sem_post@@GLIBC_2.4

The error doesn't say any line number or any location about the error, so I don't know which part of the code I should post. How can I get rid of this error? Thanks.

like image 841
jason Avatar asked Oct 20 '14 11:10

jason


1 Answers

sem_post() lives in the pthread library, so make sure you use the -pthread flag when compiling and linking.

like image 173
nos Avatar answered Nov 11 '22 03:11

nos