Closed GoogleCodeExporter closed 9 years ago
What system are you using Google Test on? What are the commands you use and
what are the error messages?
Note that we do not write FindGTest.cmake; you should contact CMake authors
about it.
Original comment by vladlosev
on 27 Apr 2010 at 6:38
> What system are you using Google Test on?
GNU/Linux, gtest-1.5.0, cmake-2.8.1
> What are the commands you use
add_executable (prgnm-test ${prgnm-test_srcs})
target_link_libraries (prgnm-test gtest)
add_test(prgnm-test prgnm-test)
> and what are the error messages?
Linking CXX executable prgnm-test
/usr/lib/gcc/i486-slackware-linux/4.4.3/../../../libgtest.so: undefined
reference to `pthread_key_create'
/usr/lib/gcc/i486-slackware-linux/4.4.3/../../../libgtest.so: undefined
reference to `pthread_getspecific'
/usr/lib/gcc/i486-slackware-linux/4.4.3/../../../libgtest.so: undefined
reference to `pthread_key_delete'
/usr/lib/gcc/i486-slackware-linux/4.4.3/../../../libgtest.so: undefined
reference to `pthread_setspecific'
collect2: выполнение ld завершилось с кодом
возврата 1
make[3]: *** [test/prgnm-test] Ошибка 1
make[2]: *** [test/CMakeFiles/prgnm-test.dir/all] Ошибка 2
make[1]: *** [test/CMakeFiles/check.dir/rule] Ошибка 2
make: *** [check] Ошибка 2
Yes, I know that target_link_libraries (prgnm-test gtest pthreads) works fine.
Original comment by intergal...@gmail.com
on 27 Apr 2010 at 7:49
Oops, target_link_libraries (prgnm-test gtest pthread) of course.
Original comment by intergal...@gmail.com
on 27 Apr 2010 at 7:55
If you use CMake, the best way to handle this is to add
add_subdirectory(<path_to_gtest_root>)
before you use the gtest library in your CMake script.
Original comment by vl...@google.com
on 3 May 2010 at 4:27
Closing, as we don't maintain FindGTest.cmake.
Original comment by vladlosev
on 13 May 2010 at 8:54
Original issue reported on code.google.com by
intergal...@gmail.com
on 25 Apr 2010 at 9:16