undefined reference to `pthread_key_create' (linker error)

前端 未结 5 705
庸人自扰
庸人自扰 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:44

    You need to specify -pthread after -lgtest. The linker takes libraries in order, and only takes as much as it needs to resolve references which are undefined at that point.

提交回复
热议问题