RainerKuemmerle / g2o

g2o: A General Framework for Graph Optimization
3.1k stars 1.11k forks source link

Tests fail to compile on FreeBSD #711

Open yurivict opened 1 year ago

yurivict commented 1 year ago
ld: error: undefined symbol: testing::AssertionSuccess()
>>> referenced by data_queue_tests.cpp
>>>               unit_test/data/CMakeFiles/unittest_data.dir/data_queue_tests.cpp.o:(Data_DataQueue_Test::TestBody())
>>> referenced by data_queue_tests.cpp
>>>               unit_test/data/CMakeFiles/unittest_data.dir/data_queue_tests.cpp.o:(Data_DataQueue_Test::TestBody())
>>> referenced by data_queue_tests.cpp
>>>               unit_test/data/CMakeFiles/unittest_data.dir/data_queue_tests.cpp.o:(testing::AssertionResult testing::internal::CmpHelperFloatingPointEQ<double>(char const*, char const*, double, double))
>>> referenced 3 more times

ld: error: undefined symbol: testing::Message::Message()
>>> referenced by data_queue_tests.cpp
>>>               unit_test/data/CMakeFiles/unittest_data.dir/data_queue_tests.cpp.o:(Data_DataQueue_Test::TestBody())
>>> referenced by data_queue_tests.cpp
>>>               unit_test/data/CMakeFiles/unittest_data.dir/data_queue_tests.cpp.o:(Data_DataQueue_Test::TestBody())
>>> referenced by data_queue_tests.cpp
>>>               unit_test/data/CMakeFiles/unittest_data.dir/data_queue_tests.cpp.o:(Data_DataQueue_Test::TestBody())
>>> referenced 13 more times

ld: error: undefined symbol: testing::internal::AssertHelper::AssertHelper(testing::TestPartResult::Type, char const*, int, char const*)
>>> referenced by data_queue_tests.cpp
>>>               unit_test/data/CMakeFiles/unittest_data.dir/data_queue_tests.cpp.o:(Data_DataQueue_Test::TestBody())
>>> referenced by data_queue_tests.cpp
>>>               unit_test/data/CMakeFiles/unittest_data.dir/data_queue_tests.cpp.o:(Data_DataQueue_Test::TestBody())
>>> referenced by data_queue_tests.cpp
>>>               unit_test/data/CMakeFiles/unittest_data.dir/data_queue_tests.cpp.o:(Data_DataQueue_Test::TestBody())
>>> referenced 12 more times

ld: error: undefined symbol: testing::internal::AssertHelper::operator=(testing::Message const&) const
>>> referenced by data_queue_tests.cpp
>>>               unit_test/data/CMakeFiles/unittest_data.dir/data_queue_tests.cpp.o:(Data_DataQueue_Test::TestBody())
>>> referenced by data_queue_tests.cpp
>>>               unit_test/data/CMakeFiles/unittest_data.dir/data_queue_tests.cpp.o:(Data_DataQueue_Test::TestBody())
>>> referenced by data_queue_tests.cpp
>>>               unit_test/data/CMakeFiles/unittest_data.dir/data_queue_tests.cpp.o:(Data_DataQueue_Test::TestBody())
>>> referenced 12 more times

ld: error: undefined symbol: testing::internal::AssertHelper::~AssertHelper()
>>> referenced by data_queue_tests.cpp
>>>               unit_test/data/CMakeFiles/unittest_data.dir/data_queue_tests.cpp.o:(Data_DataQueue_Test::TestBody())
>>> referenced by data_queue_tests.cpp
>>>               unit_test/data/CMakeFiles/unittest_data.dir/data_queue_tests.cpp.o:(Data_DataQueue_Test::TestBody())
>>> referenced by io_data.cpp
>>>               unit_test/data/CMakeFiles/unittest_data.dir/io_data.cpp.o:(Data_ReadWriteRobotLaser_Test::TestBody())
>>> referenced 7 more times

ld: error: undefined symbol: testing::internal::GetTestTypeId()
>>> referenced by data_queue_tests.cpp
>>>               unit_test/data/CMakeFiles/unittest_data.dir/data_queue_tests.cpp.o:(_GLOBAL__sub_I_data_queue_tests.cpp)
>>> referenced by io_data.cpp
>>>               unit_test/data/CMakeFiles/unittest_data.dir/io_data.cpp.o:(_GLOBAL__sub_I_io_data.cpp)

ld: error: undefined symbol: testing::internal::MakeAndRegisterTestInfo(char const*, char const*, char const*, char const*, testing::internal::CodeLocation, void const*, void (*)(), void (*)(), testing::internal::TestFactoryBase*)
>>> referenced by data_queue_tests.cpp
>>>               unit_test/data/CMakeFiles/unittest_data.dir/data_queue_tests.cpp.o:(_GLOBAL__sub_I_data_queue_tests.cpp)
>>> referenced by io_data.cpp
>>>               unit_test/data/CMakeFiles/unittest_data.dir/io_data.cpp.o:(_GLOBAL__sub_I_io_data.cpp)

ld: error: undefined symbol: testing::internal::IsTrue(bool)
>>> referenced by data_queue_tests.cpp
>>>               unit_test/data/CMakeFiles/unittest_data.dir/data_queue_tests.cpp.o:(testing::internal::SuiteApiResolver<testing::Test>::GetSetUpCaseOrSuite(char const*, int))
>>> referenced by data_queue_tests.cpp
>>>               unit_test/data/CMakeFiles/unittest_data.dir/data_queue_tests.cpp.o:(testing::internal::SuiteApiResolver<testing::Test>::GetTearDownCaseOrSuite(char const*, int))
>>> referenced by io_data.cpp
>>>               unit_test/data/CMakeFiles/unittest_data.dir/io_data.cpp.o:(testing::AssertionResult testing::internal::PredicateFormatterFromMatcher<testing::internal::SizeIsMatcher<unsigned long>>::operator()<std::__1::vector<double, std::__1::allocator<double>>>(char const*, std::__1::vector<double, std::__1::allocator<double>> const&) const)
>>> referenced 27 more times

ld: error: undefined symbol: testing::internal::GTestLog::GTestLog(testing::internal::GTestLogSeverity, char const*, int)
>>> referenced by data_queue_tests.cpp
>>>               unit_test/data/CMakeFiles/unittest_data.dir/data_queue_tests.cpp.o:(testing::internal::SuiteApiResolver<testing::Test>::GetSetUpCaseOrSuite(char const*, int))
>>> referenced by data_queue_tests.cpp
>>>               unit_test/data/CMakeFiles/unittest_data.dir/data_queue_tests.cpp.o:(testing::internal::SuiteApiResolver<testing::Test>::GetTearDownCaseOrSuite(char const*, int))
>>> referenced by io_data.cpp
>>>               unit_test/data/CMakeFiles/unittest_data.dir/io_data.cpp.o:(testing::AssertionResult testing::internal::PredicateFormatterFromMatcher<testing::internal::SizeIsMatcher<unsigned long>>::operator()<std::__1::vector<double, std::__1::allocator<double>>>(char const*, std::__1::vector<double, std::__1::allocator<double>> const&) const)
>>> referenced 27 more times

ld: error: undefined symbol: testing::internal::GTestLog::~GTestLog()
>>> referenced by data_queue_tests.cpp
>>>               unit_test/data/CMakeFiles/unittest_data.dir/data_queue_tests.cpp.o:(testing::internal::SuiteApiResolver<testing::Test>::GetSetUpCaseOrSuite(char const*, int))
>>> referenced by data_queue_tests.cpp
>>>               unit_test/data/CMakeFiles/unittest_data.dir/data_queue_tests.cpp.o:(testing::internal::SuiteApiResolver<testing::Test>::GetSetUpCaseOrSuite(char const*, int))
>>> referenced by data_queue_tests.cpp
>>>               unit_test/data/CMakeFiles/unittest_data.dir/data_queue_tests.cpp.o:(testing::internal::SuiteApiResolver<testing::Test>::GetTearDownCaseOrSuite(char const*, int))
>>> referenced 57 more times

ld: error: undefined symbol: testing::internal::StringStreamToString(std::__1::basic_stringstream<char, std::__1::char_traits<char>, std::__1::allocator<char>>*)
>>> referenced by data_queue_tests.cpp
>>>               unit_test/data/CMakeFiles/unittest_data.dir/data_queue_tests.cpp.o:(testing::AssertionResult testing::internal::CmpHelperFloatingPointEQ<double>(char const*, char const*, double, double))
>>> referenced by data_queue_tests.cpp
>>>               unit_test/data/CMakeFiles/unittest_data.dir/data_queue_tests.cpp.o:(testing::AssertionResult testing::internal::CmpHelperFloatingPointEQ<double>(char const*, char const*, double, double))

ld: error: undefined symbol: testing::internal::EqFailure(char const*, char const*, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>> const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>> const&, bool)
>>> referenced by data_queue_tests.cpp
>>>               unit_test/data/CMakeFiles/unittest_data.dir/data_queue_tests.cpp.o:(testing::AssertionResult testing::internal::CmpHelperFloatingPointEQ<double>(char const*, char const*, double, double))
>>> referenced by data_queue_tests.cpp
>>>               unit_test/data/CMakeFiles/unittest_data.dir/data_queue_tests.cpp.o:(testing::AssertionResult testing::internal::CmpHelperEQFailure<g2o::RobotData*, g2o::RobotData*>(char const*, char const*, g2o::RobotData* const&, g2o::RobotData* const&))

ld: error: undefined symbol: testing::Test::~Test()
>>> referenced by data_queue_tests.cpp
>>>               unit_test/data/CMakeFiles/unittest_data.dir/data_queue_tests.cpp.o:(Data_DataQueue_Test::~Data_DataQueue_Test())
>>> referenced by data_queue_tests.cpp
>>>               unit_test/data/CMakeFiles/unittest_data.dir/data_queue_tests.cpp.o:(vtable for Data_DataQueue_Test)
>>> referenced by io_data.cpp
>>>               unit_test/data/CMakeFiles/unittest_data.dir/io_data.cpp.o:(Data_ReadWriteRobotLaser_Test::~Data_ReadWriteRobotLaser_Test())
>>> referenced 1 more times

ld: error: undefined symbol: testing::Test::Test()
>>> referenced by data_queue_tests.cpp
>>>               unit_test/data/CMakeFiles/unittest_data.dir/data_queue_tests.cpp.o:(testing::internal::TestFactoryImpl<Data_DataQueue_Test>::CreateTest())
>>> referenced by io_data.cpp
>>>               unit_test/data/CMakeFiles/unittest_data.dir/io_data.cpp.o:(testing::internal::TestFactoryImpl<Data_ReadWriteRobotLaser_Test>::CreateTest())

ld: error: undefined symbol: testing::Test::SetUp()
>>> referenced by data_queue_tests.cpp
>>>               unit_test/data/CMakeFiles/unittest_data.dir/data_queue_tests.cpp.o:(vtable for Data_DataQueue_Test)
>>> referenced by io_data.cpp
>>>               unit_test/data/CMakeFiles/unittest_data.dir/io_data.cpp.o:(vtable for Data_ReadWriteRobotLaser_Test)

ld: error: undefined symbol: testing::Test::TearDown()
>>> referenced by data_queue_tests.cpp
>>>               unit_test/data/CMakeFiles/unittest_data.dir/data_queue_tests.cpp.o:(vtable for Data_DataQueue_Test)
>>> referenced by io_data.cpp
>>>               unit_test/data/CMakeFiles/unittest_data.dir/io_data.cpp.o:(vtable for Data_ReadWriteRobotLaser_Test)

ld: error: undefined symbol: typeinfo for testing::Test
>>> referenced by data_queue_tests.cpp
>>>               unit_test/data/CMakeFiles/unittest_data.dir/data_queue_tests.cpp.o:(typeinfo for Data_DataQueue_Test)
>>> referenced by io_data.cpp
>>>               unit_test/data/CMakeFiles/unittest_data.dir/io_data.cpp.o:(typeinfo for Data_ReadWriteRobotLaser_Test)

ld: error: undefined symbol: testing::internal::GetBoolAssertionFailureMessage(testing::AssertionResult const&, char const*, char const*, char const*)
>>> referenced by io_data.cpp
>>>               unit_test/data/CMakeFiles/unittest_data.dir/io_data.cpp.o:(Data_ReadWriteRobotLaser_Test::TestBody())
>>> referenced by io_data.cpp
>>>               unit_test/data/CMakeFiles/unittest_data.dir/io_data.cpp.o:(Data_ReadWriteRobotLaser_Test::TestBody())

ld: error: undefined symbol: testing::AssertionFailure()
>>> referenced by io_data.cpp
>>>               unit_test/data/CMakeFiles/unittest_data.dir/io_data.cpp.o:(testing::AssertionResult testing::internal::PredicateFormatterFromMatcher<testing::internal::SizeIsMatcher<unsigned long>>::operator()<std::__1::vector<double, std::__1::allocator<double>>>(char const*, std::__1::vector<double, std::__1::allocator<double>> const&) const)
>>> referenced by io_data.cpp
>>>               unit_test/data/CMakeFiles/unittest_data.dir/io_data.cpp.o:(testing::AssertionResult testing::internal::PredicateFormatterFromMatcher<testing::internal::PointwiseMatcher<NearEqMatcher, std::__1::vector<double, std::__1::allocator<double>>>>::operator()<std::__1::vector<double, std::__1::allocator<double>>>(char const*, std::__1::vector<double, std::__1::allocator<double>> const&) const)
>>> referenced by io_data.cpp
>>>               unit_test/data/CMakeFiles/unittest_data.dir/io_data.cpp.o:(testing::AssertionResult testing::internal::PredicateFormatterFromMatcher<testing::internal::PointwiseMatcher<PointsNearEqMatcher, std::__1::vector<Eigen::Matrix<double, 2, 1, 0, 2, 1>, std::__1::allocator<Eigen::Matrix<double, 2, 1, 0, 2, 1>>>>>::operator()<std::__1::vector<Eigen::Matrix<double, 2, 1, 0, 2, 1>, std::__1::allocator<Eigen::Matrix<double, 2, 1, 0, 2, 1>>>>(char const*, std::__1::vector<Eigen::Matrix<double, 2, 1, 0, 2, 1>, std::__1::allocator<Eigen::Matrix<double, 2, 1, 0, 2, 1>>> const&) const)

ld: error: undefined symbol: testing::AssertionResult::AssertionResult(testing::AssertionResult const&)
>>> referenced by io_data.cpp
>>>               unit_test/data/CMakeFiles/unittest_data.dir/io_data.cpp.o:(testing::AssertionResult testing::internal::PredicateFormatterFromMatcher<testing::internal::SizeIsMatcher<unsigned long>>::operator()<std::__1::vector<double, std::__1::allocator<double>>>(char const*, std::__1::vector<double, std::__1::allocator<double>> const&) const)
>>> referenced by io_data.cpp
>>>               unit_test/data/CMakeFiles/unittest_data.dir/io_data.cpp.o:(testing::AssertionResult testing::internal::PredicateFormatterFromMatcher<testing::internal::PointwiseMatcher<NearEqMatcher, std::__1::vector<double, std::__1::allocator<double>>>>::operator()<std::__1::vector<double, std::__1::allocator<double>>>(char const*, std::__1::vector<double, std::__1::allocator<double>> const&) const)
>>> referenced by io_data.cpp
>>>               unit_test/data/CMakeFiles/unittest_data.dir/io_data.cpp.o:(testing::AssertionResult testing::internal::PredicateFormatterFromMatcher<testing::internal::PointwiseMatcher<PointsNearEqMatcher, std::__1::vector<Eigen::Matrix<double, 2, 1, 0, 2, 1>, std::__1::allocator<Eigen::Matrix<double, 2, 1, 0, 2, 1>>>>>::operator()<std::__1::vector<Eigen::Matrix<double, 2, 1, 0, 2, 1>, std::__1::allocator<Eigen::Matrix<double, 2, 1, 0, 2, 1>>>>(char const*, std::__1::vector<Eigen::Matrix<double, 2, 1, 0, 2, 1>, std::__1::allocator<Eigen::Matrix<double, 2, 1, 0, 2, 1>>> const&) const)

ld: error: too many errors emitted, stopping now (use --error-limit=0 to see all errors)
c++: error: linker command failed with exit code 1 (use -v to see invocation)
[  6% 7/33] : && /usr/local/libexec/ccache/c++ -O2 -pipe -fstack-protector-strong -isystem /usr/local/include -fno-strict-aliasing  -isystem /usr/local/include  -Wall -O2 -pipe -fstack-protector-strong -isystem /usr/local/include -fno-strict-aliasing  -isystem /usr/local/include  -DNDEBUG -L/usr/local/lib -fstack-protector-strong unit_test/general/CMakeFiles/unittest_general.dir/allocate_optimizer.cpp.o unit_test/general/CMakeFiles/unittest_general.dir/auto_diff.cpp.o unit_test/general/CMakeFiles/unittest_general.dir/batch_statistics.cpp.o unit_test/general/CMakeFiles/unittest_general.dir/graph_operations.cpp.o unit_test/general/CMakeFiles/unittest_general.dir/clear_and_redo.cpp.o unit_test/general/CMakeFiles/unittest_general.dir/base_fixed_sized_edge.cpp.o unit_test/general/CMakeFiles/unittest_general.dir/robust_kernel_tests.cpp.o unit_test/general/CMakeFiles/unittest_general.dir/sparse_block_matrix.cpp.o -o bin/unittest_general  -Wl,-rpath,/usr/ports/math/g2o/work/.build/lib  lib/libg2o_types_slam3d.so.0.1.0  lib/libg2o_types_slam2d.so.0.1.0  -lgmock_main  lib/libg2o_core.so.0.1.0  lib/libg2o_stuff.so.0.1.0  lib/libg2o_opengl_helper.so.0.1.0  /usr/local/lib/libGLU.so  /usr/local/lib/libGLX.so  /usr/local/lib/libOpenGL.so && :
FAILED: bin/unittest_general 
: && /usr/local/libexec/ccache/c++ -O2 -pipe -fstack-protector-strong -isystem /usr/local/include -fno-strict-aliasing  -isystem /usr/local/include  -Wall -O2 -pipe -fstack-protector-strong -isystem /usr/local/include -fno-strict-aliasing  -isystem /usr/local/include  -DNDEBUG -L/usr/local/lib -fstack-protector-strong unit_test/general/CMakeFiles/unittest_general.dir/allocate_optimizer.cpp.o unit_test/general/CMakeFiles/unittest_general.dir/auto_diff.cpp.o unit_test/general/CMakeFiles/unittest_general.dir/batch_statistics.cpp.o unit_test/general/CMakeFiles/unittest_general.dir/graph_operations.cpp.o unit_test/general/CMakeFiles/unittest_general.dir/clear_and_redo.cpp.o unit_test/general/CMakeFiles/unittest_general.dir/base_fixed_sized_edge.cpp.o unit_test/general/CMakeFiles/unittest_general.dir/robust_kernel_tests.cpp.o unit_test/general/CMakeFiles/unittest_general.dir/sparse_block_matrix.cpp.o -o bin/unittest_general  -Wl,-rpath,/usr/ports/math/g2o/work/.build/lib  lib/libg2o_types_slam3d.so.0.1.0  lib/libg2o_types_slam2d.so.0.1.0  -lgmock_main  lib/libg2o_core.so.0.1.0  lib/libg2o_stuff.so.0.1.0  lib/libg2o_opengl_helper.so.0.1.0  /usr/local/lib/libGLU.so  /usr/local/lib/libGLX.so  /usr/local/lib/libOpenGL.so && :
ld: error: undefined symbol: testing::Message::Message()
>>> referenced by auto_diff.cpp
>>>               unit_test/general/CMakeFiles/unittest_general.dir/auto_diff.cpp.o:(AutoDifferentiation_ComputesSomething_Test::TestBody())
>>> referenced by auto_diff.cpp
>>>               unit_test/general/CMakeFiles/unittest_general.dir/auto_diff.cpp.o:(AutoDifferentiation_ComputesSomething_Test::TestBody())
>>> referenced by auto_diff.cpp
>>>               unit_test/general/CMakeFiles/unittest_general.dir/auto_diff.cpp.o:(AutoDifferentiation_ComputesSomething_Test::TestBody())
>>> referenced 289 more times

ld: error: undefined symbol: testing::internal::GetBoolAssertionFailureMessage(testing::AssertionResult const&, char const*, char const*, char const*)
>>> referenced by auto_diff.cpp
>>>               unit_test/general/CMakeFiles/unittest_general.dir/auto_diff.cpp.o:(AutoDifferentiation_ComputesSomething_Test::TestBody())
>>> referenced by auto_diff.cpp
>>>               unit_test/general/CMakeFiles/unittest_general.dir/auto_diff.cpp.o:(AutoDifferentiation_ComputesSomething_Test::TestBody())
>>> referenced by auto_diff.cpp
>>>               unit_test/general/CMakeFiles/unittest_general.dir/auto_diff.cpp.o:(AutoDifferentiation_ComputesSomething_Test::TestBody())
>>> referenced 42 more times

ld: error: undefined symbol: testing::internal::AssertHelper::AssertHelper(testing::TestPartResult::Type, char const*, int, char const*)
>>> referenced by auto_diff.cpp
>>>               unit_test/general/CMakeFiles/unittest_general.dir/auto_diff.cpp.o:(AutoDifferentiation_ComputesSomething_Test::TestBody())
>>> referenced by auto_diff.cpp
>>>               unit_test/general/CMakeFiles/unittest_general.dir/auto_diff.cpp.o:(AutoDifferentiation_ComputesSomething_Test::TestBody())
>>> referenced by auto_diff.cpp
>>>               unit_test/general/CMakeFiles/unittest_general.dir/auto_diff.cpp.o:(AutoDifferentiation_ComputesSomething_Test::TestBody())
>>> referenced 260 more times

ld: error: undefined symbol: testing::internal::AssertHelper::operator=(testing::Message const&) const
>>> referenced by auto_diff.cpp
>>>               unit_test/general/CMakeFiles/unittest_general.dir/auto_diff.cpp.o:(AutoDifferentiation_ComputesSomething_Test::TestBody())
>>> referenced by auto_diff.cpp
>>>               unit_test/general/CMakeFiles/unittest_general.dir/auto_diff.cpp.o:(AutoDifferentiation_ComputesSomething_Test::TestBody())
>>> referenced by auto_diff.cpp
>>>               unit_test/general/CMakeFiles/unittest_general.dir/auto_diff.cpp.o:(AutoDifferentiation_ComputesSomething_Test::TestBody())
>>> referenced 260 more times

ld: error: undefined symbol: testing::internal::AssertHelper::~AssertHelper()
>>> referenced by auto_diff.cpp
>>>               unit_test/general/CMakeFiles/unittest_general.dir/auto_diff.cpp.o:(AutoDifferentiation_ComputesSomething_Test::TestBody())
>>> referenced by auto_diff.cpp
>>>               unit_test/general/CMakeFiles/unittest_general.dir/auto_diff.cpp.o:(AutoDifferentiation_ComputesSomething_Test::TestBody())
>>> referenced by auto_diff.cpp
>>>               unit_test/general/CMakeFiles/unittest_general.dir/auto_diff.cpp.o:(AutoDifferentiation_ComputesSomething_Test::TestBody())
>>> referenced 307 more times

ld: error: undefined symbol: testing::AssertionSuccess()
>>> referenced by auto_diff.cpp
>>>               unit_test/general/CMakeFiles/unittest_general.dir/auto_diff.cpp.o:(AutoDifferentiation_ComputesNothingForFixed_Test::TestBody())
>>> referenced by auto_diff.cpp
>>>               unit_test/general/CMakeFiles/unittest_general.dir/auto_diff.cpp.o:(AutoDifferentiation_ComputesNothingForFixed_Test::TestBody())
>>> referenced by auto_diff.cpp
>>>               unit_test/general/CMakeFiles/unittest_general.dir/auto_diff.cpp.o:(AutoDifferentiationEdgeSE2_AdComputesSomething_Test::TestBody())
>>> referenced 114 more times

ld: error: undefined symbol: testing::internal::MakeAndRegisterTestInfo(char const*, char const*, char const*, char const*, testing::internal::CodeLocation, void const*, void (*)(), void (*)(), testing::internal::TestFactoryBase*)
>>> referenced by auto_diff.cpp
>>>               unit_test/general/CMakeFiles/unittest_general.dir/auto_diff.cpp.o:(_GLOBAL__sub_I_auto_diff.cpp)
>>> referenced by auto_diff.cpp
>>>               unit_test/general/CMakeFiles/unittest_general.dir/auto_diff.cpp.o:(_GLOBAL__sub_I_auto_diff.cpp)
>>> referenced by auto_diff.cpp
>>>               unit_test/general/CMakeFiles/unittest_general.dir/auto_diff.cpp.o:(_GLOBAL__sub_I_auto_diff.cpp)
>>> referenced 65 more times

ld: error: undefined symbol: testing::internal::IsTrue(bool)
>>> referenced by auto_diff.cpp
>>>               unit_test/general/CMakeFiles/unittest_general.dir/auto_diff.cpp.o:(testing::internal::SuiteApiResolver<AutoDifferentiation>::GetSetUpCaseOrSuite(char const*, int))
>>> referenced by auto_diff.cpp
>>>               unit_test/general/CMakeFiles/unittest_general.dir/auto_diff.cpp.o:(testing::internal::SuiteApiResolver<AutoDifferentiation>::GetTearDownCaseOrSuite(char const*, int))
>>> referenced by auto_diff.cpp
>>>               unit_test/general/CMakeFiles/unittest_general.dir/auto_diff.cpp.o:(testing::internal::SuiteApiResolver<AutoDifferentiationEdgeSE2>::GetSetUpCaseOrSuite(char const*, int))
>>> referenced 311 more times

ld: error: undefined symbol: testing::internal::GTestLog::GTestLog(testing::internal::GTestLogSeverity, char const*, int)
>>> referenced by auto_diff.cpp
>>>               unit_test/general/CMakeFiles/unittest_general.dir/auto_diff.cpp.o:(testing::internal::SuiteApiResolver<AutoDifferentiation>::GetSetUpCaseOrSuite(char const*, int))
>>> referenced by auto_diff.cpp
>>>               unit_test/general/CMakeFiles/unittest_general.dir/auto_diff.cpp.o:(testing::internal::SuiteApiResolver<AutoDifferentiation>::GetTearDownCaseOrSuite(char const*, int))
>>> referenced by auto_diff.cpp
>>>               unit_test/general/CMakeFiles/unittest_general.dir/auto_diff.cpp.o:(testing::internal::SuiteApiResolver<AutoDifferentiationEdgeSE2>::GetSetUpCaseOrSuite(char const*, int))
>>> referenced 311 more times

ld: error: undefined symbol: testing::internal::GTestLog::~GTestLog()
>>> referenced by auto_diff.cpp
>>>               unit_test/general/CMakeFiles/unittest_general.dir/auto_diff.cpp.o:(testing::internal::SuiteApiResolver<AutoDifferentiation>::GetSetUpCaseOrSuite(char const*, int))
>>> referenced by auto_diff.cpp
>>>               unit_test/general/CMakeFiles/unittest_general.dir/auto_diff.cpp.o:(testing::internal::SuiteApiResolver<AutoDifferentiation>::GetSetUpCaseOrSuite(char const*, int))
>>> referenced by auto_diff.cpp
>>>               unit_test/general/CMakeFiles/unittest_general.dir/auto_diff.cpp.o:(testing::internal::SuiteApiResolver<AutoDifferentiation>::GetTearDownCaseOrSuite(char const*, int))
>>> referenced 622 more times

ld: error: undefined symbol: testing::internal::StringStreamToString(std::__1::basic_stringstream<char, std::__1::char_traits<char>, std::__1::allocator<char>>*)
>>> referenced by auto_diff.cpp
>>>               unit_test/general/CMakeFiles/unittest_general.dir/auto_diff.cpp.o:(testing::AssertionResult testing::internal::CmpHelperFloatingPointEQ<double>(char const*, char const*, double, double))
>>> referenced by auto_diff.cpp
>>>               unit_test/general/CMakeFiles/unittest_general.dir/auto_diff.cpp.o:(testing::AssertionResult testing::internal::CmpHelperFloatingPointEQ<double>(char const*, char const*, double, double))

ld: error: undefined symbol: testing::internal::EqFailure(char const*, char const*, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>> const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>> const&, bool)
>>> referenced by auto_diff.cpp
>>>               unit_test/general/CMakeFiles/unittest_general.dir/auto_diff.cpp.o:(testing::AssertionResult testing::internal::CmpHelperFloatingPointEQ<double>(char const*, char const*, double, double))
>>> referenced by batch_statistics.cpp
>>>               unit_test/general/CMakeFiles/unittest_general.dir/batch_statistics.cpp.o:(testing::AssertionResult testing::internal::CmpHelperEQFailure<char [3], std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>>>(char const*, char const*, char const (&) [3], std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>> const&))
>>> referenced by batch_statistics.cpp
>>>               unit_test/general/CMakeFiles/unittest_general.dir/batch_statistics.cpp.o:(testing::AssertionResult testing::internal::CmpHelperEQFailure<char [5], std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>>>(char const*, char const*, char const (&) [5], std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>> const&))
>>> referenced 12 more times

ld: error: undefined symbol: testing::Test::~Test()
>>> referenced by auto_diff.cpp
>>>               unit_test/general/CMakeFiles/unittest_general.dir/auto_diff.cpp.o:(AutoDifferentiation::~AutoDifferentiation())
>>> referenced by auto_diff.cpp
>>>               unit_test/general/CMakeFiles/unittest_general.dir/auto_diff.cpp.o:(AutoDifferentiationEdgeSE2::~AutoDifferentiationEdgeSE2())
>>> referenced by auto_diff.cpp
>>>               unit_test/general/CMakeFiles/unittest_general.dir/auto_diff.cpp.o:(AutoDifferentiation::AutoDifferentiation())
>>> referenced 103 more times

ld: error: undefined symbol: testing::Test::Test()
>>> referenced by auto_diff.cpp
>>>               unit_test/general/CMakeFiles/unittest_general.dir/auto_diff.cpp.o:(AutoDifferentiation::AutoDifferentiation())
>>> referenced by auto_diff.cpp
>>>               unit_test/general/CMakeFiles/unittest_general.dir/auto_diff.cpp.o:(AutoDifferentiationEdgeSE2::AutoDifferentiationEdgeSE2())
>>> referenced by batch_statistics.cpp
>>>               unit_test/general/CMakeFiles/unittest_general.dir/batch_statistics.cpp.o:(testing::internal::TestFactoryImpl<General_BatchStatisticsOutput_Test>::CreateTest())
>>> referenced 45 more times

ld: error: undefined symbol: testing::AssertionFailure()
>>> referenced by auto_diff.cpp
>>>               unit_test/general/CMakeFiles/unittest_general.dir/auto_diff.cpp.o:(testing::AssertionResult testing::internal::CmpHelperOpFailure<int, double>(char const*, char const*, int const&, double const&, char const*))
>>> referenced by graph_operations.cpp
>>>               unit_test/general/CMakeFiles/unittest_general.dir/graph_operations.cpp.o:(GeneralGraphOperations_LoadingGraph_Test::TestBody())
>>> referenced by graph_operations.cpp
>>>               unit_test/general/CMakeFiles/unittest_general.dir/graph_operations.cpp.o:(GeneralGraphOperations_LoadingGraph_Test::TestBody())
>>> referenced 45 more times

ld: error: undefined symbol: testing::AssertionResult::AssertionResult(testing::AssertionResult const&)
>>> referenced by auto_diff.cpp
>>>               unit_test/general/CMakeFiles/unittest_general.dir/auto_diff.cpp.o:(testing::AssertionResult testing::internal::CmpHelperOpFailure<int, double>(char const*, char const*, int const&, double const&, char const*))
>>> referenced by graph_operations.cpp
>>>               unit_test/general/CMakeFiles/unittest_general.dir/graph_operations.cpp.o:(GeneralGraphOperations_LoadingGraph_Test::TestBody())
>>> referenced by graph_operations.cpp
>>>               unit_test/general/CMakeFiles/unittest_general.dir/graph_operations.cpp.o:(GeneralGraphOperations_LoadingGraph_Test::TestBody())
>>> referenced 45 more times

ld: error: undefined symbol: testing::Message::GetString() const
>>> referenced by auto_diff.cpp
>>>               unit_test/general/CMakeFiles/unittest_general.dir/auto_diff.cpp.o:(testing::AssertionResult::AppendMessage(testing::Message const&))
>>> referenced by graph_operations.cpp
>>>               unit_test/general/CMakeFiles/unittest_general.dir/graph_operations.cpp.o:(testing::internal::ElementsAreMatcherImpl<std::__1::vector<int, std::__1::allocator<int>> const&>::DescribeTo(std::__1::basic_ostream<char, std::__1::char_traits<char>>*) const)
>>> referenced by graph_operations.cpp
>>>               unit_test/general/CMakeFiles/unittest_general.dir/graph_operations.cpp.o:(testing::internal::ElementsAreMatcherImpl<std::__1::vector<int, std::__1::allocator<int>> const&>::DescribeNegationTo(std::__1::basic_ostream<char, std::__1::char_traits<char>>*) const)
>>> referenced 15 more times

ld: error: undefined symbol: testing::Test::TearDown()
>>> referenced by auto_diff.cpp
>>>               unit_test/general/CMakeFiles/unittest_general.dir/auto_diff.cpp.o:(vtable for AutoDifferentiation_ComputesSomething_Test)
>>> referenced by auto_diff.cpp
>>>               unit_test/general/CMakeFiles/unittest_general.dir/auto_diff.cpp.o:(vtable for AutoDifferentiation_ComputesNothingForFixed_Test)
>>> referenced by auto_diff.cpp
>>>               unit_test/general/CMakeFiles/unittest_general.dir/auto_diff.cpp.o:(vtable for AutoDifferentiationEdgeSE2_AdComputesSomething_Test)
>>> referenced 77 more times

ld: error: undefined symbol: typeinfo for testing::Test
>>> referenced by auto_diff.cpp
>>>               unit_test/general/CMakeFiles/unittest_general.dir/auto_diff.cpp.o:(typeinfo for AutoDifferentiation)
>>> referenced by auto_diff.cpp
>>>               unit_test/general/CMakeFiles/unittest_general.dir/auto_diff.cpp.o:(typeinfo for AutoDifferentiationEdgeSE2)
>>> referenced by batch_statistics.cpp
>>>               unit_test/general/CMakeFiles/unittest_general.dir/batch_statistics.cpp.o:(typeinfo for General_BatchStatisticsOutput_Test)
>>> referenced 28 more times

ld: error: undefined symbol: testing::internal::GetTestTypeId()
>>> referenced by batch_statistics.cpp
>>>               unit_test/general/CMakeFiles/unittest_general.dir/batch_statistics.cpp.o:(_GLOBAL__sub_I_batch_statistics.cpp)
>>> referenced by graph_operations.cpp
>>>               unit_test/general/CMakeFiles/unittest_general.dir/graph_operations.cpp.o:(_GLOBAL__sub_I_graph_operations.cpp)
>>> referenced by graph_operations.cpp
>>>               unit_test/general/CMakeFiles/unittest_general.dir/graph_operations.cpp.o:(_GLOBAL__sub_I_graph_operations.cpp)
>>> referenced 16 more times

ld: error: too many errors emitted, stopping now (use --error-limit=0 to see all errors)

Version: 20230806 clang-14 FreeBSD 13.2

RainerKuemmerle commented 1 year ago

I need more information here. Using a VirtualBox machine (freebsd 13.2 amd64)

$ clang --version
FreeBSD clang version 14.0.5 (https://github.com/llvm/llvm-project.git llvmorg-14.0.5-0-gc12386ae247c)
Target: x86_64-unknown-freebsd13.2
Thread model: posix
InstalledDir: /usr/bin

I can nicely build, for example, the stuff test is afterwards linked as follows to gtest

bin/unittest_stuff:
    libg2o_stuff.so.0.1 => /home/goki/workspace/g2o/build/lib/libg2o_stuff.so.0.1 (0x3e6bc17d2000)
    libgmock_main.so.1.14.0 => /home/goki/workspace/g2o/build/lib/libgmock_main.so.1.14.0 (0x3e6bc2f9f000)
    libgmock.so.1.14.0 => /home/goki/workspace/g2o/build/lib/libgmock.so.1.14.0 (0x3e6bc19a2000)
    libgtest.so.1.14.0 => /home/goki/workspace/g2o/build/lib/libgtest.so.1.14.0 (0x3e6bc1aee000)
    libthr.so.3 => /lib/libthr.so.3 (0x3e6bc202d000)
    libc++.so.1 => /usr/lib/libc++.so.1 (0x3e6bc3d66000)
    libcxxrt.so.1 => /lib/libcxxrt.so.1 (0x3e6bc4cb7000)
    libm.so.5 => /lib/libm.so.5 (0x3e6bc4ce2000)
    libgcc_s.so.1 => /lib/libgcc_s.so.1 (0x3e6bc541b000)
    libc.so.7 => /lib/libc.so.7 (0x3e6bc6100000)
    [vdso] (0x7ffffffff5d0)

Please provide the output of make VERBOSE=1 or more information on how your linker is called. Or which command sequence you used.

I found a dependency issue problem in one of the examples when there is no OPENGL found but that should be unrelated to the linking issue for gtest.

RainerKuemmerle commented 1 year ago

@yurivict Would be interesting to understand if master fixes the issue for you. Thanks.