Adding -pthread to eclipse, for using posix threads15/02/2009
Cannot compile c/c++ project with -pthread. Eclipse is complaining about things.
Eclipse is not configured to put the -pthread argument in the gcc compilation. To solve this, go to the Menu:
Project -> Properties
From the bar on the left:
c/c++ build -> GCC C Compiler -> Miscellaneous
Add the “-pthread” argument into the beginning of the “Other Flags” Also go to:
c/c++ build -> Settings -> GCC C Linker -> Libraries
And include the “pthread”library into the other libraries. Click Apply and rebuild the project. Pthreads must work now.