我的CMake环境存在问题。 我的团队使用CppUnit,但是自升级到OS X 10.10(Yosemite)以来,我们的测试版本一直在失败 此版本适用于Linux机器和OS X Mavericks。 我们不知道为什么它不起作用。
我们的CMakeLists.txt可以在这里找到:https://gist.github.com/VikomMedia/802fb41a411dd2f7358e
...
Linking CXX executable sailbot_test
Undefined symbols for architecture x86_64:
"SailingLogicTest::testShouldBeat()", referenced from:
SailingLogicTest::addTestsToSuite(CppUnit::TestSuiteBuilderContextBase&) in SailingLogicTest.cpp.o
"SailingLogicTest::testIsThereChangeToAWA()", referenced from:
SailingLogicTest::addTestsToSuite(CppUnit::TestSuiteBuilderContextBase&) in SailingLogicTest.cpp.o
"SailingLogicTest::testCanReachDestWithoutTack()", referenced from:
SailingLogicTest::addTestsToSuite(CppUnit::TestSuiteBuilderContextBase&) in SailingLogicTest.cpp.o
"SailingLogicTest::testIsThereChangeToAWAorBearing()", referenced from:
SailingLogicTest::addTestsToSuite(CppUnit::TestSuiteBuilderContextBase&) in SailingLogicTest.cpp.o
"CppUnit::SourceLine::SourceLine(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, int)", referenced from:
SailingLogicTest::testArrivedAtDest() in SailingLogicTest.cpp.o
SailingLogicTest::testGetBearing() in SailingLogicTest.cpp.o
...
可在此处找到完整日志:https://gist.github.com/VikomMedia/71ee83dcd6f7b538a343
结果与-stdlib = libc ++和-stdlib = libstdc ++
相同非常感谢。
答案 0 :(得分:0)
我们能够通过在OS X 10.10计算机上将编译器更改为G ++来解决此问题。 clang ++没有用,原因目前尚不清楚。