解决办法:重新编译代码
sudo apt-get install libgtest-dev
sudo apt-get install cmake # install cmake
cd /usr/src/gtest
sudo cmake CMakeLists.txt
sudo make
#copy or symlink libgtest.a and libgtest_main.a to your /usr/lib folder
sudo cp *.a /usr/lib
来源:关于C ++:CMake在Ubuntu中找不到GoogleTest所需的库 | 码农家园 (codenong.com)