GNOME Bugzilla – Bug 750602
'make check' gives '/usr/bin/ld: cannot find -lgtest'
Last modified: 2015-07-31 11:47:21 UTC
According to Google Test FAQ [1], linking with pre-compiled gtest is no longer recommended. Autoconf script bundled with gtest [2] is considered deprecated and thus system package maintainers use it as an excuse to make it unusable (at least Ubuntu 14.04 does so - they don't provide a proper gtest-config file). We need to either: 1. search the system for gtest sources (e.g. Ubuntu 14.04 has them in /usr/src/gtest, given libgtest-dev package is installed), 2. bundle gtest sources with gstreamermm, 3. download gtest sources as a tarball and unpack it while building, 4. provide them as a git submodule or 5. fix the Google Test packages in distros :-). [1] https://code.google.com/p/googletest/wiki/V1_7_FAQ#Why_is_it_not_recommended_to_install_a_pre-compiled_copy_of_Goog [2] https://code.google.com/p/googletest/source/browse/trunk/m4/gtest.m4 [3] https://bugs.launchpad.net/ubuntu/+source/gtest/+bug/877424/comments/4
(In reply to Michał Wróbel from comment #0) > According to Google Test FAQ [1], linking with pre-compiled gtest is no > longer recommended. Autoconf script bundled with gtest [2] is considered > deprecated and thus system package maintainers use it as an excuse to make > it unusable (at least Ubuntu 14.04 does so - they don't provide a proper > gtest-config file). > > We need to either: > 1. search the system for gtest sources (e.g. Ubuntu 14.04 has them in > /usr/src/gtest, given libgtest-dev package is installed), Is there any generic method for searching sources in the other distros? Moreover, it could be a problem, if we wanted to compile and run tests e.g. on Windows (in the future). > 2. bundle gtest sources with gstreamermm, Merging gtest with gstreamermm on newer gtest's versions is IHMO unnecessary, if we can just download it from somewhere else. > 3. download gtest sources as a tarball and unpack it while building, That's imo the best solution > 4. provide them as a git submodule or I can't find official git repository. Have you found one? > 5. fix the Google Test packages in distros :-).
This problem has been fixed in the unstable development version. The fix will be available in the next major software release.