|
我是winxp系统,vc6。使用cppunit的mfc方式的输出成功了。但是我换成win32 console工程,连接的是同一个库(cppunitd.lib和testrunnerd.lib),使用textUi时,通过编译,但连接出错。请问有人知道是怎么一回事吗?
//驱动模块
#include <cppunit/CompilerOutputter.h>
#include <cppunit/extensions/TestFactoryRegistry.h>
#include <cppunit/ui/Text/TestRunner.h>
int main(int argc, char *argv[])
{
CppUnit::TextUi::TestRunner runner;
CppUnit::TestFactoryRegistry ®istry = CppUnit::TestFactoryRegistry::getRegistry("AllTest");
runner.addTest(registry.makeTest());
return runner.run();
}
//eror message
Linking...
msvcprtd.lib(MSVCP60D.dll) : error LNK2005: "public: __thiscall std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >::~basic_string<char,struct std::char_traits<char>,class std::allocator<char> >(void)" (??1?$basic_strin
g@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAE@XZ) already defined in main.obj
msvcprtd.lib(MSVCP60D.dll) : error LNK2005: "public: class std::basic_ostream<char,struct std::char_traits<char> > & __thiscall std::basic_ostream<char,struct std::char_traits<char> >::flush(void)" (?flush@?$basic_ostream@DU?$char_traits@D@std@@@std
@@QAEAAV12@XZ) already defined in myTestCase.obj
msvcprtd.lib(MSVCP60D.dll) : error LNK2005: "public: __thiscall std::ios_base::Init::Init(void)" (??0Init@ios_base@std@@QAE@XZ) already defined in libcpd.lib(iostream.obj)
msvcprtd.lib(MSVCP60D.dll) : error LNK2005: "public: __thiscall std::ios_base::Init::~Init(void)" (??1Init@ios_base@std@@QAE@XZ) already defined in libcpd.lib(iostream.obj)
msvcprtd.lib(MSVCP60D.dll) : error LNK2005: "public: __thiscall std::_Winit::_Winit(void)" (??0_Winit@std@@QAE@XZ) already defined in libcpd.lib(wiostrea.obj)
msvcprtd.lib(MSVCP60D.dll) : error LNK2005: "public: __thiscall std::_Winit::~_Winit(void)" (??1_Winit@std@@QAE@XZ) already defined in libcpd.lib(wiostrea.obj)
msvcprtd.lib(MSVCP60D.dll) : error LNK2005: "public: __thiscall std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >(class std::basic_string<c
har,struct std::char_traits<char>,class std::allocator<char> > const &)" (??0?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAE@ABV01@@Z) already defined in myTestCase.obj
msvcprtd.lib(MSVCP60D.dll) : error LNK2005: "public: __thiscall std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >(char const *,class std::a
llocator<char> const &)" (??0?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAE@PBDABV?$allocator@D@1@@Z) already defined in main.obj
msvcprtd.lib(MSVCP60D.dll) : error LNK2005: "public: __thiscall std::_Lockit::~_Lockit(void)" (??1_Lockit@std@@QAE@XZ) already defined in myTestCase.obj
msvcprtd.lib(MSVCP60D.dll) : error LNK2005: "public: __thiscall std::_Lockit::_Lockit(void)" (??0_Lockit@std@@QAE@XZ) already defined in myTestCase.obj
msvcprtd.lib(MSVCP60D.dll) : error LNK2005: "public: __thiscall std:ut_of_range:ut_of_range(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &)" (??0out_of_range@std@@QAE@ABV?$basic_string@DU?$char_tr
aits@D@std@@V?$allocator@D@2@@1@@Z) already defined in libcpd.lib(string.obj)
msvcprtd.lib(MSVCP60D.dll) : error LNK2005: "public: __thiscall std::logic_error::logic_error(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &)" (??0logic_error@std@@QAE@ABV?$basic_string@DU?$char_trait
s@D@std@@V?$allocator@D@2@@1@@Z) already defined in libcpd.lib(string.obj)
msvcprtd.lib(MSVCP60D.dll) : error LNK2005: "public: virtual __thiscall std::logic_error::~logic_error(void)" (??1logic_error@std@@UAE@XZ) already defined in libcpd.lib(string.obj)
msvcprtd.lib(MSVCP60D.dll) : error LNK2005: "public: __thiscall std::logic_error::logic_error(class std::logic_error const &)" (??0logic_error@std@@QAE@ABV01@@Z) already defined in libcpd.lib(string.obj)
msvcprtd.lib(MSVCP60D.dll) : error LNK2005: "public: __thiscall std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >(class std::allocator<char
> const &)" (??0?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAE@ABV?$allocator@D@1@@Z) already defined in myTestCase.obj
msvcprtd.lib(MSVCP60D.dll) : error LNK2005: "public: char const * __thiscall std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >::c_str(void)const " (?c_str@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@Q
BEPBDXZ) already defined in myTestCase.obj
msvcprtd.lib(MSVCP60D.dll) : error LNK2005: "public: class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > & __thiscall std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >:perator=(ch
ar const *)" (??4?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAEAAV01@PBD@Z) already defined in libcpd.lib(locale0.obj)
msvcprtd.lib(MSVCP60D.dll) : error LNK2005: "public: class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > & __thiscall std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >:perator=(cl
ass std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &)" (??4?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAEAAV01@ABV01@@Z) already defined in myTestCase.obj
msvcprtd.lib(MSVCP60D.dll) : error LNK2005: "public: class std::basic_ostream<char,struct std::char_traits<char> > & __thiscall std::basic_ostream<char,struct std::char_traits<char> >:perator<<(int)" (??6?$basic_ostream@DU?$char_traits@D@std@@@std
@@QAEAAV01@H@Z) already defined in myTestCase.obj
msvcprtd.lib(MSVCP60D.dll) : error LNK2005: "public: class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > & __thiscall std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >:perator+=(c
lass std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &)" (??Y?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAEAAV01@ABV01@@Z) already defined in libcpd.lib(locale.obj)
msvcprtd.lib(MSVCP60D.dll) : error LNK2005: "public: class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > & __thiscall std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >:perator+=(c
har)" (??Y?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAEAAV01@D@Z) already defined in libcpd.lib(locale.obj)
msvcprtd.lib(MSVCP60D.dll) : error LNK2005: "public: char & __thiscall std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >:perator[](unsigned int)" (??A?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAEA
ADI@Z) already defined in libcpd.lib(locale.obj)
MSVCRTD.lib(MSVCRTD.dll) : error LNK2005: "public: virtual __thiscall exception::~exception(void)" (??1exception@@UAE@XZ) already defined in LIBCD.lib(stdexcpt.obj)
MSVCRTD.lib(MSVCRTD.dll) : error LNK2005: "public: __thiscall exception::exception(class exception const &)" (??0exception@@QAE@ABV0@@Z) already defined in LIBCD.lib(stdexcpt.obj)
MSVCRTD.lib(MSVCRTD.dll) : error LNK2005: "public: __thiscall exception::exception(void)" (??0exception@@QAE@XZ) already defined in LIBCD.lib(stdexcpt.obj)
LINK : warning LNK4098: defaultlib "MSVCRTD" conflicts with use of other libs; use /NODEFAULTLIB:library
Debug/testcppunit_text.exe : fatal error LNK1169: one or more multiply defined symbols found
Error executing link.exe.
testcppunit_text.exe - 26 error(s), 1 warning(s) |
|