undefined reference to `pthread_key_create' (linker error)

前端 未结 5 698
庸人自扰
庸人自扰 2020-11-29 11:51

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

5条回答
  •  醉梦人生
    2020-11-29 12:37

    Use -pthread instead of -lpthread (for linking with pthread-library), while you using gtest in your executable.

    OR

    Move the -lpthread after libgtest.a (sequence matters).

提交回复
热议问题