Skip to content
langdead edited this page Mar 1, 2015 · 1 revision
  • To fix libgtest dependency problem.

//--------------compiling error-----------

/usr/bin/ld: /your_gest_build_path//libgtest.a(gtest-all.cc.o): undefined reference to symbol 'pthread_key_delete@@GLIBC_2.2.5' /lib/x86_64-linux-gnu/libpthread.so.0: error adding symbols: DSO missing from command line collect2: error: ld returned 1 exit status make: *** [run-all-tests] Error 1

//--------------sollution-----------------

adding -lpthread to the line LIBS += -lgtest in snap/test/Makefile, and execute make run again.

REF: http://stackoverflow.com/questions/25617839/undefined-reference-to-symbol-pthread-key-deleteglibc-2-2-5

My local example command:

*/snap/test$ LDFLAGS=-L/your_gtest_build_path/ CXXFLAGS=-I/your_gtest_path//include make run

Clone this wiki locally