Link problem, help!

Link problem, help!

I got following error message when I compiled one of my products. Any clue to resolve this? msvcprt.lib(MSVCP90.dll) : error LNK2005: "public: __thiscall std::basic_string,class std::allocator >::~basic_string,class std::allocator >(void)" (??1?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAE@XZ) already defined in Canvas.obj 1>msvcprt.lib(MSVCP90.dll) : error LNK2005: "public: __thiscall std::basic_string,class std::allocator >::basic_string,class std::allocator >(char const *)" (??0?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAE@PBD@Z) already defined in Canvas.obj 1>msvcprt.lib(MSVCP90.dll) : error LNK2005: "public: __thiscall std::basic_string,class std::allocator >::basic_string,class std::allocator >(class std::basic_string,class std::allocator > const &)" (??0?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAE@ABV01@@Z) already defined in Canvas.obj 1>msvcprt.lib(MSVCP90.dll) : error LNK2005: "public: class std::basic_string,class std::allocator > & __thiscall std::basic_string,class std::allocator >::erase(unsigned int,unsigned int)" (?erase@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAEAAV12@II@Z) already defined in Canvas.obj 1>msvcprt.lib(MSVCP90.dll) : error LNK2005: "public: class std::basic_string,class std::allocator > & __thiscall std::basic_string,class std::allocator >::assign(char const *)" (?assign@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAEAAV12@PBD@Z) already defined in Canvas.obj 1>msvcprt.lib(MSVCP90.dll) : error LNK2005: "protected: void __thiscall std::basic_string,class std::allocator >::_Tidy(bool,unsigned int)" (?_Tidy@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@IAEX_NI@Z) already defined in Canvas.obj
7 posts / 0 new
Last post
For more complete information about compiler optimizations, see our Optimization Notice.

Open your Project Properties -> C/C++ -> Runtime Library -> Multi-threaded DLL (/MD)

For Release version - Multi-threaded DLL (/MD)
For Debug version - Multi-threaded Debug DLL (/MDd)

Linking
Applications and components must be statically linked with the Application Service library that corresponds to their target runtime. The table below lists the static libraries.(developer guide.pdf page11 )

Should be Runtime Library -> Multi-threaded (/MT)

When you change to /MD,it can compile successfully. But the program can't run also with the all DLL file.

Any other idea?

When I compile the program with (/MD).
need the follow dll file:

msvcr90.dll
CoreDll.dll
mmvcr70.dll
mmvcp70.dll

The result is "Can't locate the number 1443 in coredll.dll".

Who can help me? Thanks!

Hong,

It looks like you may be including a particular CPP file to many times. Please have a look at this link:

http://www.gamedev.net/reference/programming/features/orgfiles/page4.asp
* Scroll down to "Fixing Problem 4"

You are right. Thank you. I have fixed that.

So that means the library of Atom SDK is built with DLL runtime library. OK. I don't like it but it seems I have to accept it.

Yes, Atom SDK libraries linked dynamically. Don't forget to include CRT libraries to your installer.

Leave a Comment

Please sign in to add a comment. Not a member? Join today