undefined reference to `pthread_key_create' (linker error)
问题 I have downloaded gtest 1.7.0 sources from here: https://code.google.com/p/googletest/downloads/list and build the gtest .a files (lib files) on ubuntu 13.10: Linux ubuntu 3.11.0-15-generic #23-Ubuntu SMP Mon Dec 9 18:17:04 UTC 2013 x86_64 x86_64 x86_64 GNU/Linux and the resulting lib is called: libgtest.a . In my main.cpp file Have: #include <iostream> #include "gtest/gtest.h" int main(){ std::cout << "Test \n"; int argc = 2; char* cp01; char* cp02; char* argv[] = {cp01, cp02}; testing: