Managed C++ MFC Problem

T

Tommy Vercetti

I'm trying to upgrade a large MFC C++ application to Managed C++.

I get a strange link error (at end of message). It appears to be
duplicate STL string symbols between the MFC DLL and one of my classes.
I've commented the class file down to a minimalist stub file. It should
compile/link but won't run correctly. I still get this strange error. I
can't really pare this down much more for testing purposes. Any ideas?

msvcprtd.lib(MSVCP71D.dll) : error LNK2005: "public: class
std::basic_string<wchar_t,struct std::char_traits<wchar_t>,class
std::allocator said:
::erase(unsigned int,unsigned int)"
(?erase@?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QAEAAV12@II@Z)
already defined in DomainDataMgr.obj
msvcprtd.lib(MSVCP71D.dll) : error LNK2005: "public: unsigned int
__thiscall std::basic_string<wchar_t,struct
std::char_traits said:
::size(void)const "
(?size@?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QBEIXZ)
already defined in DomainDataMgr.obj
msvcprtd.lib(MSVCP71D.dll) : error LNK2005: "public: __thiscall
std::basic_string<wchar_t,struct std::char_traits<wchar_t>,class
std::allocator<wchar_t> >::basic_string<wchar_t,struct
std::char_traits<wchar_t>,class std::allocator<wchar_t> >(class
std::basic_string<wchar_t,struct std::char_traits<wchar_t>,class
std::allocator<wchar_t> > const &)"
(??0?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QAE@ABV01@@Z)
already defined in DomainDataMgr.obj
msvcprtd.lib(MSVCP71D.dll) : error LNK2005: "public: unsigned int
__thiscall std::basic_string<wchar_t,struct
std::char_traits said:
::max_size(void)const "
(?max_size@?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QBEIXZ)
already defined in DomainDataMgr.obj
 
T

Tommy Vercetti

Tommy said:
I'm trying to upgrade a large MFC C++ application to Managed C++.

I need to use MFC/runtime as a DLL since I'm using Boost threads (which
won't work with a statically linked runtime). Might this have something
to do with it? Has anyone gotten a Boost/MFC app ported to Managed C++?
I guess a simple test would be worth a shot.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top