Can Cppunit work with Visual Studio 2005?

View: New views
2 Messages — Rating Filter:   Alert me  

Can Cppunit work with Visual Studio 2005?

by cppunit-devel mailing list :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Can Cppunit work with Visual Studio 2005?

I tried recompiling our software containing Cppunit with Visual Studio 2005 and have very similar errors reported by Srivalli last month (3/6/07) "Compiling Money Example on Visual Studio 2005" but unfortunately, I don't see a helpful answer yet.

We have been using Cppunit 10.0.2 (from June 18, 2004) and Microsoft Visual Studio .NET 2003.

I see the latest Cppunit version is 1.12.0 which was released June 30, 2006.

Can Cppunit 10.0.2 work with VS 2005?  Can Cppunit 1.12.0 work with VS 2005?  How do you resolve the following unresolved external symbols reported by Srivali?

----------------------------------------------------
When I compile Money Example of CPPUnit 1.11.0 with Visual Studio 2005 Professional Edition, I am getting linker errors for files cppunitd.lib, msvsprtd.lib as in:

error LNK2019: unresolved external symbol "__declspec(dllimport) public: char const * __thiscall type_info::name(void)const " (__imp_?name@type_info@@QBEPBDXZ) referenced in function "public: static class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > __cdecl CppUnit::TypeInfoHelper::getClassName(class type_info const &)" (?getClassName@TypeInfoHelper@CppUnit@@SA?AV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@ABVtype_info@@@Z) cppunitd.lib

error LNK2005: "class std::basic_ostream<char,struct std::char_traits<char> > & __cdecl std::operator<<<char,struct std::char_traits<char>,class std::allocator<char> >(class std::basic_ostream<char,struct std::char_traits<char> > &,class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &)" (??$?6DU?$char_traits@D@std@@V?$allocator@D@1@@std@@YAAAV?$basic_ostream@DU?$char_traits@D@std@@@0@AAV10@ABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@0@@Z) already defined in cppunitd.lib(TextTestRunner.obj) msvcprtd.lib

----------------------------------------------------
I'll forward a partial extraction of what I am getting when I recompile our software with VS 2005 after my name so you can see that similar errors (LNK2005 and LNK2019) are involved:

Thanks,
Loreene

----------------------------------------------------------------------------
cl -c -Ic:/home/wildcat/include -Ic:/home/wildcat/include/boost-1_32 -I.. -TP -EHsc -MD -GR -FoCloneableTest.o CloneableTest.cc

Microsoft (R) 32-bit C/C++ Optimizing Compiler Version 14.00.50727.42 for 80x86
Copyright (C) Microsoft Corporation.  All rights reserved.

CloneableTest.cc
link -out:CloneableTests CloneableTest.o  -LIBPATH:c:/home/wildcat/lib -SUBSYSTEM:CONSOLE UnitTestMain.lib cppunit.lib
Microsoft (R) Incremental Linker Version 8.00.50727.42
Copyright (C) Microsoft Corporation.  All rights reserved.

msvcprt.lib(MSVCP80.dll) : error LNK2005: "class std::basic_ostream<char,struct std::char_traits<char> > & __cdecl std::operator<<<char,struct std::char_traits<char>,class std::allocator<char> >(class std::basic_ostream<char,struct std::char_traits<char> > &,class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &)" (??$?6DU?$char_traits@D@std@@V?$allocator@D@1@@std@@YAAAV?$basic_ostream@DU?$char_traits@D@std@@@0@AAV10@ABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@0@@Z) already defined in cppunit.lib(SourceLine.obj)

msvcprt.lib(MSVCP80.dll) : error LNK2005: "class std::basic_ostream<char,struct std::char_traits<char> > & __cdecl std::operator<<<struct std::char_traits<char> >(class std::basic_ostream<char,struct std::char_traits<char> > &,char const *)" (??$?6U?$char_traits@D@std@@@std@@YAAAV?$basic_ostream@DU?$char_traits@D@std@@@0@AAV10@PBD@Z) already defined in UnitTestMain.lib(CppUnitTestMain.o)

cppunit.lib(TypeInfoHelper.obj) : error LNK2019: unresolved external symbol "__declspec(dllimport) public: char const * __thiscall type_info::name(void)const " (__imp_?name@type_info@@QBEPBDXZ) referenced in function "public: static class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > __cdecl CppUnit::TypeInfoHelper::getClassName(class type_info const &)" (?getClassName@TypeInfoHelper@CppUnit@@SA?AV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@ABVtype_info@@@Z)

cppunit.lib(StringTools.obj) : error LNK2019: unresolved external symbol "__declspec(dllimport) public: class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >::const_iterator __thiscall std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >::end(void)const " (__imp_?end@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QBE?AVconst_iterator@12@XZ) referenced in function "public: static class std::vector<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >,class std::allocator<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > > > __cdecl CppUnit::StringTools::split(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &,char)" (?split@StringTools@CppUnit@@SA?AV?$vector@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@V?$allocator@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@2@@std@@ABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@4@D@Z)

cppunit.lib(StringTools.obj) : error LNK2019: unresolved external symbol "__declspec(dllimport) public: class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >::const_iterator __thiscall std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >::begin(void)const " (__imp_?begin@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QBE?AVconst_iterator@12@XZ) referenced in function "public: static class std::vector<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >,class std::allocator<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > > > __cdecl CppUnit::StringTools::split(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &,char)" (?split@StringTools@CppUnit@@SA?AV?$vector@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@V?$allocator@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@2@@std@@ABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@4@D@Z)

CloneableTests : fatal error LNK1120: 3 unresolved externals
make[1]: *** [CloneableTests] Error 96


-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Cppunit-devel mailing list
Cppunit-devel@...
https://lists.sourceforge.net/lists/listinfo/cppunit-devel

Re: Can Cppunit work with Visual Studio 2005?

by James Wang :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

I have encountered the same problems when trying to use the CppUnit with VS2005, but finally I resolved it. You should rebuild the CppUnit Library (cppunit, cppunit_dll, testrunner & testpluginrunner) by using vs2005 again, hopefully this could help you.

-James

cppunit-devel mailing list wrote:
I tried recompiling our software containing Cppunit with Visual Studio
2005 and have very similar errors reported by Srivalli last month
(3/6/07) "Compiling Money Example on Visual Studio 2005" but
unfortunately, I don't see a helpful answer yet.

We have been using Cppunit 10.0.2 (from June 18, 2004) and Microsoft
Visual Studio .NET 2003.

I see the latest Cppunit version is 1.12.0 which was released June 30,
2006.

Can Cppunit 10.0.2 work with VS 2005?  Can Cppunit 1.12.0 work with VS
2005?  How do you resolve the following unresolved external symbols
reported by Srivali?

----------------------------------------------------
When I compile Money Example of CPPUnit 1.11.0 with Visual Studio 2005
Professional Edition, I am getting linker errors for files cppunitd.lib,
msvsprtd.lib as in:

error LNK2019: unresolved external symbol "__declspec(dllimport) public:
char const * __thiscall type_info::name(void)const "
(__imp_?name@type_info@@QBEPBDXZ) referenced in function "public: static
class std::basic_string<char,struct std::char_traits<char>,class
std::allocator<char> > __cdecl
CppUnit::TypeInfoHelper::getClassName(class type_info const &)"
(?getClassName@TypeInfoHelper@CppUnit@@SA?AV?$basic_string@DU?$char_trai
ts@D@std@@V?$allocator@D@2@@std@@ABVtype_info@@@Z) cppunitd.lib

error LNK2005: "class std::basic_ostream<char,struct
std::char_traits<char> > & __cdecl std::operator<<<char,struct
std::char_traits<char>,class std::allocator<char> >(class
std::basic_ostream<char,struct std::char_traits<char> > &,class
std::basic_string<char,struct std::char_traits<char>,class
std::allocator<char> > const &)"
(??$?6DU?$char_traits@D@std@@V?$allocator@D@1@@std@@YAAAV?$basic_ostream
@DU?$char_traits@D@std@@@0@AAV10@ABV?$basic_string@DU?$char_traits@D@std
@@V?$allocator@D@2@@0@@Z) already defined in
cppunitd.lib(TextTestRunner.obj) msvcprtd.lib
----------------------------------------------------
I'll forward a partial extraction of what I am getting when I recompile
our software with VS 2005 after my name so you can see that similar
errors (LNK2005 and LNK2019) are involved:
Thanks,
Loreene
------------------------------------------------------------------------
----
cl -c -Ic:/home/wildcat/include -Ic:/home/wildcat/include/boost-1_32
-I.. -TP -EHsc -MD -GR -FoCloneableTest.o CloneableTest.cc
Microsoft (R) 32-bit C/C++ Optimizing Compiler Version 14.00.50727.42
for 80x86
Copyright (C) Microsoft Corporation.  All rights reserved.

CloneableTest.cc
link -out:CloneableTests CloneableTest.o  -LIBPATH:c:/home/wildcat/lib
-SUBSYSTEM:CONSOLE UnitTestMain.lib cppunit.lib
Microsoft (R) Incremental Linker Version 8.00.50727.42
Copyright (C) Microsoft Corporation.  All rights reserved.

msvcprt.lib(MSVCP80.dll) : error LNK2005: "class
std::basic_ostream<char,struct std::char_traits<char> > & __cdecl
std::operator<<<char,struct std::char_traits<char>,class
std::allocator<char> >(class std::basic_ostream<char,struct
std::char_traits<char> > &,class std::basic_string<char,struct
std::char_traits<char>,class std::allocator<char> > const &)"
(??$?6DU?$char_traits@D@std@@V?$allocator@D@1@@std@@YAAAV?$basic_ostream
@DU?$char_traits@D@std@@@0@AAV10@ABV?$basic_string@DU?$char_traits@D@std
@@V?$allocator@D@2@@0@@Z) already defined in cppunit.lib(SourceLine.obj)
msvcprt.lib(MSVCP80.dll) : error LNK2005: "class
std::basic_ostream<char,struct std::char_traits<char> > & __cdecl
std::operator<<<struct std::char_traits<char> >(class
std::basic_ostream<char,struct std::char_traits<char> > &,char const *)"
(??$?6U?$char_traits@D@std@@@std@@YAAAV?$basic_ostream@DU?$char_traits@D
@std@@@0@AAV10@PBD@Z) already defined in
UnitTestMain.lib(CppUnitTestMain.o)
cppunit.lib(TypeInfoHelper.obj) : error LNK2019: unresolved external
symbol "__declspec(dllimport) public: char const * __thiscall
type_info::name(void)const " (__imp_?name@type_info@@QBEPBDXZ)
referenced in function "public: static class
std::basic_string<char,struct std::char_traits<char>,class
std::allocator<char> > __cdecl
CppUnit::TypeInfoHelper::getClassName(class type_info const &)"
(?getClassName@TypeInfoHelper@CppUnit@@SA?AV?$basic_string@DU?$char_trai
ts@D@std@@V?$allocator@D@2@@std@@ABVtype_info@@@Z)
cppunit.lib(StringTools.obj) : error LNK2019: unresolved external symbol
"__declspec(dllimport) public: class std::basic_string<char,struct
std::char_traits<char>,class std::allocator<char> >::const_iterator
__thiscall std::basic_string<char,struct std::char_traits<char>,class
std::allocator<char> >::end(void)const "
(__imp_?end@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@
@QBE?AVconst_iterator@12@XZ) referenced in function "public: static
class std::vector<class std::basic_string<char,struct
std::char_traits<char>,class std::allocator<char> >,class
std::allocator<class std::basic_string<char,struct
std::char_traits<char>,class std::allocator<char> > > > __cdecl
CppUnit::StringTools::split(class std::basic_string<char,struct
std::char_traits<char>,class std::allocator<char> > const &,char)"
(?split@StringTools@CppUnit@@SA?AV?$vector@V?$basic_string@DU?$char_trai
ts@D@std@@V?$allocator@D@2@@std@@V?$allocator@V?$basic_string@DU?$char_t
raits@D@std@@V?$allocator@D@2@@std@@@2@@std@@ABV?$basic_string@DU?$char_
traits@D@std@@V?$allocator@D@2@@4@D@Z)
cppunit.lib(StringTools.obj) : error LNK2019: unresolved external symbol
"__declspec(dllimport) public: class std::basic_string<char,struct
std::char_traits<char>,class std::allocator<char> >::const_iterator
__thiscall std::basic_string<char,struct std::char_traits<char>,class
std::allocator<char> >::begin(void)const "
(__imp_?begin@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@st
d@@QBE?AVconst_iterator@12@XZ) referenced in function "public: static
class std::vector<class std::basic_string<char,struct
std::char_traits<char>,class std::allocator<char> >,class
std::allocator<class std::basic_string<char,struct
std::char_traits<char>,class std::allocator<char> > > > __cdecl
CppUnit::StringTools::split(class std::basic_string<char,struct
std::char_traits<char>,class std::allocator<char> > const &,char)"
(?split@StringTools@CppUnit@@SA?AV?$vector@V?$basic_string@DU?$char_trai
ts@D@std@@V?$allocator@D@2@@std@@V?$allocator@V?$basic_string@DU?$char_t
raits@D@std@@V?$allocator@D@2@@std@@@2@@std@@ABV?$basic_string@DU?$char_
traits@D@std@@V?$allocator@D@2@@4@D@Z)
CloneableTests : fatal error LNK1120: 3 unresolved externals
make[1]: *** [CloneableTests] Error 96


-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Cppunit-devel mailing list
Cppunit-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/cppunit-devel