Thread: [Cppunit-devel] How to use cppunit on AIX5L?
Brought to you by:
blep
From: Huiting H. <heh...@zd...> - 2005-04-12 06:36:41
|
Hi, =20 I'm writing to you for help because I've met some problems while using cppuint. My OS is AIX5L; I download cppunit-1.10.2 from http://sourceforge.net/projects/cppunit I have tried to install cppunit followed the instruction: 1. `cd' to the directory containing the package's source code and type `. /configure --disable-shared --disable-typeinfo-name` 2. Type `gmake' to compile the package. 3. Optionally, type `gmake check' to run any self-tests that come with the package. 4. Type `gmake install' to install the programs and any data files and documentation. Problem happened during the third step.=20 bash-2.05$ gmake check Making check in src gmake [1]: Entering directory `/home/hth/testcase/cppunit-1.10.2/src' Making check in cppunit gmake [2]: Entering directory `/home/hth/testcase/cppunit-1.10.2/src/cppunit' gmake [2]: Nothing to be done for `check'. gmake [2]: Leaving directory `/home/hth/testcase/cppunit-1.10.2/src/cppunit' Making check in DllPlugInTester gmake [2]: Entering directory `/home/hth/testcase/cppunit-1.10.2/src/DllPlugInTester' gmake DllPlugInTesterTest gmake [3]: Entering directory `/home/hth/testcase/cppunit-1.10.2/src/DllPlugInTester' source=3D'DllPlugInTesterTest.cpp' object=3D'DllPlugInTesterTest.o' libtool=3Dno \ depfile=3D'.deps/DllPlugInTesterTest.Po' tmpdepfile=3D'.deps/DllPlugInTesterTest.TPo' \ depmode=3Dgcc /bin/sh../../config/depcomp \ g++ -DHAVE_CONFIG_H -I. -I. -I../../config -I../../include -I../../include -g -O2 -c -o DllPlugInTesterTest.o `test -f 'DllPlugInTesterTest.cpp' || echo './'`DllPlugInTesterTest.cpp source=3D'CommandLineParserTest.cpp' object=3D'CommandLineParserTest.o' libtool=3Dno \ depfile=3D'.deps/CommandLineParserTest.Po' tmpdepfile=3D'.deps/CommandLineParserTest.TPo' \ depmode=3Dgcc /bin/sh ../../config/depcomp \ g++ -DHAVE_CONFIG_H -I. -I. -I../../config -I../../include -I../../include -g -O2 -c -o CommandLineParserTest.o `test -f 'CommandLineParserTest.cpp' || echo './'`CommandLineParserTest.cpp /bin/sh ../../libtool --mode=3Dlink g++ -g -O2 -o DllPlugInTesterTest -ldl DllPlugInTesterTest.o CommandLineParser.o CommandLineParserTest.o ../../src/cppunit/libcppunit.la g++ -g -O2 -o DllPlugInTesterTest DllPlugInTesterTest.o CommandLineParser.o CommandLineParserTest.o -ldl ../../src/cppunit/.libs/libcppunit.a gmake[3]: Leaving directory `/home/hth/testcase/cppunit-1.10.2/src/DllPlugInTester' gmake check-TESTS gmake[3]: Entering directory `/home/hth/testcase/cppunit-1.10.2/src/DllPlugInTester' /bin/sh: 77724 Illegal instructions(coredump) FAIL: DllPlugInTesterTest =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D 1 of 1 tests failed =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D gmake[3]: *** [check-TESTS] Error 1 gmake[3]: Leaving directory `/home/hth/testcase/cppunit-1.10.2/src/DllPlugInTester' gmake[2]: *** [check-am] Error 2 gmake[2]: Leaving directory `/home/hth/testcase/cppunit-1.10.2/src/DllPlugInTester' gmake[1]: *** [check-recursive] Error 1 gmake[1]: Leaving directory `/home/hth/testcase/cppunit-1.10.2/src' gmake: *** [check-recursive] Error 1 =20 It's my first time to use cppunit, so I don't know how to deal with this problem. As it is an optional step, I just skip it and did the last step and finished the installation. All the test codes under the folder "example" can be successfully compiled but can't be=20 executed -- "Illegal instruction (core dumped)". Why? I have used the test codes written on CppUnit Cookbook. What was worse, the codes=20 even can't be successfully compiled.=20 ld: 0711-317 ERROR: Undefined symbol: CppUnit::TestCase::run(CppUnit::TestResult*) ld: 0711-317 ERROR: Undefined symbol: CppUnit::TestLeaf::countTestCases() const ld: 0711-317 ERROR: Undefined symbol: CppUnit::TestLeaf::getChildTestCount() const ld: 0711-317 ERROR: Undefined symbol: CppUnit::Test::getChildTestAt(int) const ld: 0711-317 ERROR: Undefined symbol: CppUnit::TestCase::getName() const ld: 0711-317 ERROR: Undefined symbol: CppUnit::Test::findTestPath(const CppUnit::Test*,CppUnit::TestPath&) const ld: 0711-317 ERROR: Undefined symbol: CppUnit::Test::findTestPath(const std::basic_string<char,std::char_traits<char>,std::allocator<char> >&,CppUnit::TestPath&) const ld: 0711-317 ERROR: Undefined symbol: CppUnit::Test::findTest(const std::basic_string<char,std::char_traits<char>,std::allocator<char> >&) const ld: 0711-317 ERROR: Undefined symbol: CppUnit::Test::resolveTestPath(const std::basic_string<char,std::char_traits<char>,std::allocator<char> >&) const ld: 0711-317 ERROR: Undefined symbol: CppUnit::Test::checkIsValidIndex(int) const ld: 0711-317 ERROR: Undefined symbol: CppUnit::TestLeaf::doGetChildTestAt(int) const ld: 0711-317 ERROR: Undefined symbol: .CppUnit::TextTestRunner::TextTestRunner(CppUnit::Outputter*) ld: 0711-317 ERROR: Undefined symbol: .CppUnit::TestRunner::addTest(CppUnit::Test*) ld: 0711-317 ERROR: Undefined symbol: .CppUnit::TextTestRunner::run(std::basic_string<char,std::char_traits<ch ar>,std::allocator<char> >,bool,bool,bool) ld: 0711-317 ERROR: Undefined symbol: .CppUnit::TextTestRunner::~TextTestRunner() ld: 0711-317 ERROR: Undefined symbol: .operator new(unsigned long) ld: 0711-317 ERROR: Undefined symbol: .CppUnit::TestSuite::TestSuite(std::basic_string<char,std::char_traits<c har>,std::allocator<char> >) ld: 0711-317 ERROR: Undefined symbol: .CppUnit::TestSuite::addTest(CppUnit::Test*) ld: 0711-317 ERROR: Undefined symbol: .operator delete(void*) ld: 0711-317 ERROR: Undefined symbol: .CppUnit::Message::Message(const std::basic_string<char,std::char_traits<char>,std::allocator<char> >&,const std::basic_string<char,std::char_traits<char>,std::allocator<char> >&) ld: 0711-317 ERROR: Undefined symbol: .CppUnit::SourceLine::SourceLine(const std::basic_string<char,std::char_traits<char>,std::allocator<char> >&,int) ld: 0711-317 ERROR: Undefined symbol: .CppUnit::Asserter::failIf(bool,const CppUnit::Message&,const CppUnit::SourceLine&) ld: 0711-317 ERROR: Undefined symbol: .CppUnit::SourceLine::~SourceLine() ld: 0711-317 ERROR: Undefined symbol: .CppUnit::TestCase::TestCase(const std::basic_string<char,std::char_traits<char>,std::allocator<char> >&) ld: 0711-317 ERROR: Undefined symbol: .CppUnit::TestCase::~TestCase() ld: 0711-317 ERROR: Undefined symbol: .std::_String_base::_Xran() const ld: 0711-317 ERROR: Undefined symbol: .std::_String_base::_Xlen() const ld: 0711-317 ERROR: Undefined symbol: .std::__setUncaughtExceptionFlag(bool) ld: 0711-317 ERROR: Undefined symbol: .__CleanupCatch ld: 0711-317 ERROR: Undefined symbol: .operator new(unsigned long,void*) =20 I have already included all necessary head files. How to deal with this error? =20 I'm really puzzled. Could you please tell me how to use cppunit on AIX5L? Thank you very much. Looking forward to your reply. ^_^ =20 Best regards, Huiting |
From: Henning W. <hen...@di...> - 2005-04-12 18:46:45
|
Am Dienstag 12. April 2005 08:38 schrieb Huiting He: > Hi, > > I'm writing to you for help because I've met some problems while using > cppuint. > > My OS is AIX5L; I download cppunit-1.10.2 from > http://sourceforge.net/projects/cppunit > [...] > I have used the test codes written on CppUnit Cookbook. What was worse, > the codes even can't be successfully compiled. > ld: 0711-317 ERROR: Undefined symbol: > CppUnit::TestCase::run(CppUnit::TestResult*) >[...] > I have already included all necessary head files. How to deal with this > error? Hello Huiting He, the error message is from ld, that is the linker program. Have you added the appropriate linker flags to the compiler/linker invocation? On my linux system i use "-lcppunit -ldl". And did the linker find the cppunit lib? You could either install cppunit system-wide, or you must add the location of the lib to the compiler call too. You wrote that you could compile the cppunit test examples. Please refer to them for the right compiler flags. The coredump problem after the execution of the tests could be perhaps a library problem too. Best regards, Henning |