Compiling Money Example on Visual Studio 2005

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

Compiling Money Example on Visual Studio 2005

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

Reply to Author | View Threaded | Show Only this Message

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@...) 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@...) 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@...) already defined in cppunitd.lib(TextTestRunner.obj) msvcprtd.lib 
 
I am sure many of you experts out there have already solved this before. I would appreciate any help.
 
Thanks!
Srivalli.


Looking for earth-friendly autos?
Browse Top Cars by "Green Rating" at Yahoo! Autos' Green Center.
-------------------------------------------------------------------------
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: Compiling Money Example on Visual Studio 2005

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

Reply to Author | View Threaded | Show Only this Message

> error LNK2019: unresolved external symbol "__declspec(dllimport) public:
> char const * __thiscall type_info::name(void)const "

I can compile the Money example with Visual C++ 2005 Professional SP1
without any problems.

Note : I don't use the English version of Visual Studio, so the labels I
use here may not be fully the same as yours.

I use the following procedure :
1) Unpack cppunit-1.11.0.tar.gz
3) Open examples\examples.dsw and convert all projects
4) Right click on the "money" project and select "Define as startup project"
5) Right click on the "money" project and select "Properties". Go to
"Configuration properties" > "Linker" > "Input". In the list "Additional
dependencies" remove "cppunitd.lib" then click "OK".
6) Click on the menu "Build" > "Build money". There are some warnings
about sprintf. After the build, the tests are run : OK (4)


The errors you get seems to be due to inconsistent compiler options
between the static library "cppunit" and the "money" example. Especially
the option /GR for enabling RTTI (Runtime Type Information). The option
can be found in the Project Properties dialog box : "Configuration
properties" > "C/C++" > "Language" > "Enable type information"


Another point to be checked : before trying to compile with VS2005, did
you try to compile with VS2003 or another older compiler ? If you did,
make sure to "clean" your project, by deleting all directories named
"Debug" or "Release" before trying to compile again.

Good luck.

Vincent Rivière
vriviere@...

-------------------------------------------------------------------------
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