Closed yuancaimaiyi closed 3 years ago
how to solve it ?thanks @AIBluefisher
The message shows libgtest
is not found in /usr/local/lib
. Thus, you can check the directory of libgtest_main.a
at first, it could be in /usr/lib
.
Also, I found an issue in the CMakeLists.txt:
message("-- Check for gtest")
find_package(GTest REQUIRED)
if (GTEST_FOUND)
message("-- Found GTest: ${GTEST_INCLUDE_DIRS}")
set(GTEST_LIBRARIES ${GTEST_LIBRARIES}
/usr/local/lib/libgtest_main.a
/usr/local/lib/libgtest.a)
# message("-- Linked Libraries: ${GTEST_LIBRARIES}")
else (GTEST_FOUND)
message(FATAL_ERROR "Can't find GTest. Please set GTEST_INCLUDE_DIRS & GTEST_LIBRARIES")
endif (GTEST_FOUND)
I have fixed it by replacing ${GTEST_LIBRARIES}
, /usr/local/lib/libgtest_main.a
and /usr/local/lib/libgtest.a
by
${GTEST_MAIN_LIBRARY}
and ${GTEST_LIBRARY}
. Now you can use the latest version to fix this issue.
Thanks for proposing this issue.