Original Post
I'm using codeblocks for writing some unit test code.But when I finished code, I can't pass compile.I set the project in codeblocks as "GUI applicaiton". The header file: #ifndef _clsTestSuit_assert_h #define _clsTestSuit_assert_h #include class clsTestSuit_Assert : public CppUnit::TestFixture { CPPUNIT_TEST_SUITE( clsTestSuit_Assert ); CPPUNIT_TEST( testAdd ); CPPUNIT_TEST_SUITE_END(); public: void setUp(); void tearDown(); void testAdd(); private: }; #endif The cpp file: include "clsTestSuit_assert.h" #include //------------------------------------------------------------------------------ void clsTestSuit_Assert::setUp() // Comment: // [in]: // [out]: // [return]: // [5/6/2008 by duomaxwell] //------------------------------------------------------------------------------ { } //------------------------------------------------------------------------------ void clsTestSuit_Assert::tearDown() // Comment: // [in]: // [out]: // [return]: // [5/6/2008 by duomaxwell] //------------------------------------------------------------------------------ { } void clsTestSuit_Assert::testAdd() { CPPUNIT_ASSERT_MESSAGE("TEST", false); } The result it come many error LNK2019 and error LNK2001 But if I implement the "testAdd" in .h file, just like: class clsTestSuit_Assert : public CppUnit::TestFixture { CPPUNIT_TEST_SUITE( clsTestSuit_Assert ); CPPUNIT_TEST( testAdd ); CPPUNIT_TEST_SUITE_END(); public: void setUp(); void tearDown(); void testAdd() {CPPUNIT_ASSERT_MESSAGE("TEST", false);} private: }; it just warning what can I do with it?