unittest++: är det jag som är dum eller? [LÖST]
Postat: 25 maj 2009, 15:23
Jag installerade build-essential, libunittest++0 och libunittest++-dev, men gcc gnäller på mig när jag försöker kompilera första bästa exempel, hittar inte h-filen verkar det som. Den ligger i /usr/include/unittest++/UnitTest++.h och när jag lägger till flaggan -I/usr/include/unittest++/ blir den inte mycket gladare.
Jag testade även att hårdkoda pathen till h-filen i cpp-filen, men det blir inte mycket bättre.
Någon som har något bra tips?
/Per
Jag testade även att hårdkoda pathen till h-filen i cpp-filen, men det blir inte mycket bättre.
Någon som har något bra tips?
Kod: Markera allt
#include "UnitTest++.h"
TEST(MyTest)
{
CHECK(true);
}
int main(int, char const *[])
{
return UnitTest::RunAllTests();
}
Kod: Markera allt
~/code$ gcc utpp-test.cpp
utpp-test.cpp:1:24: fel: UnitTest++.h: Filen eller katalogen finns inte
utpp-test.cpp:3: fel: expected constructor, destructor, or type conversion before "(" token
utpp-test.cpp: In function "int main(int, const char**)":
utpp-test.cpp:10: fel: "UnitTest" har inte deklarerats
...
Kod: Markera allt
~/code$ gcc utpp-test.cpp -I/usr/include/unittest++
/tmp/cciwirdI.o: In function `__static_initialization_and_destruction_0(int, int)':
utpp-test.cpp:(.text+0x3f): undefined reference to `UnitTest::Test::GetTestList()'
utpp-test.cpp:(.text+0x57): undefined reference to `UnitTest::ListAdder::ListAdder(UnitTest::TestList&, UnitTest::Test*)'
...