I ran into a stupid problem with C++ and googletest.
I set up a C++ project with CMake, and included googletest for writing tests. As usual, I created a library, and respecive test executable:
add_library(mylib mylib.cc)
...
add_executable(test-mylib test-mylib.cc)
...
target_link_libraries(test-mylib mylib gtest gtest_main)