简体   繁体   中英

Linking Error with UnitTest++

I am getting an odd Unit Test ++ linking error using Xcode as my ide. Now I did set the project up with two targets. one target that will do the test the other will do nothing for now.

Note I did link the library and ran the simple working example from the tutorial. and I compiled it using gcc 4.2.1 from macports.

"std::string::c_str() const", referenced from: UnitTest::MemoryOutStream::GetText() const in libUnitTest++.a(MemoryOutStream.o) "std::basic_ostringstream, std::allocator >::str() const", referenced from: UnitTest::MemoryOutStream::GetText() const in libUnitTest++.a(MemoryOutStream.o) "std::basic_ostream >::~basic_ostream()", referenced from: construction vtable for std::ostream-in-UnitTest::MemoryOutStream in libUnitTest++.a(TestRunner.o) construction vtable for std::ostream-in-UnitTest::MemoryOutStream in libUnitTest++.a(Test.o) "std::basic_ostream >::~basic_ostream()", referenced from: construction vtable for std::ostream-in-UnitTest::MemoryOutStream in libUnitTest++.a(TestRunner.o) construction vtable for std::ostream-in-UnitTest::MemoryOutStream in libUnitTest++.a(Test.o)

Okay so all the problems went away when I switched the std library to GNU standard library rather then the llvm osx standard library. So go to build settings c++ standard library libstdc++ (GNU C++ standard library)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM