Hello experts
I want to try google test framework for c++ on ubuntu. I'm trying to build a very simple test (stripped down from one of the samples supplied by google from gtest).
My build line and output looks like:
g++ -o "HelloUnitTest" ./src/HelloUnitTest.o ./Test/TestMain.o -pthread -lgtest -lgtest_main
/usr/lib/gcc/x86_64-linux-gnu/4.8/../../../../lib/libgtest.so: undefined reference to `pthread_key_create'
/usr/lib/gcc/x86_64-linux-gnu/4.8/../../../../lib/libgtest.so: undefined reference to `pthread_getspecific'
/usr/lib/gcc/x86_64-linux-gnu/4.8/../../../../lib/libgtest.so: undefined reference to `pthread_key_delete'
/usr/lib/gcc/x86_64-linux-gnu/4.8/../../../../lib/libgtest.so: undefined reference to `pthread_setspecific'
collect2: error: ld returned 1 exit status
I have read all posts I could find about this, and tried lpthread vs pthread, linking libraries before and after the object files, linking libpthread as a static library, and many others.
Any idea what I can be doing wrong?
ps. running on ubuntu 13.10, 64 bits
Bookmarks