cartographer icon indicating copy to clipboard operation
cartographer copied to clipboard

Test compilation issue in Ubuntu 22.04

Open twdragon opened this issue 2 years ago • 1 comments

When Cartographer is compiled on Ubuntu 22.04 Jammy or derived, with libgtest-dev and libgmock-dev installed from APT, the following errors occurred in the test suite compilation (tested both on GCC and Clang):

/usr/bin/ld: CMakeFiles/cartographer.mapping.3d.hybrid_grid_test.dir/cartographer/mapping/3d/hybrid_grid_test.cc.o: в функции «cartographer::mapping::(anonymous namespace)::AllCwiseEqualMatcherP<Eigen::Array<int, 3, 1, 0, 3, 1> >::gmock_Impl<Eigen::Array<int, 3, 1, 0, 3, 1> const&>::FormatDescription[abi:cxx11](bool) const»:
hybrid_grid_test.cc:(.text+0x321b): unresolved reference to «testing::internal::FormatMatcherDescription(bool, char const*, std::vector<char const*, std::allocator<char const*> > const&, std::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > > const&)»
clang-15: error: linker command failed with exit code 1 (use -v to see invocation)

This error happened due to presence of the custom GTest value matcher in Cartographer.

Do anyone know a workaround to embed the googletest source of the proper version as a submodule?

twdragon avatar Oct 10 '22 09:10 twdragon

Solved it by installing gtest 1.8.1

zhyeJ avatar Mar 25 '24 08:03 zhyeJ