Linker error using MFC and STL
-
I have a non-MFC project using std::string that is compiled into a library (Confetti.lib). My main project is an MFC project that uses this library. I get the following linker errors: msvcprtd.lib(MSVCP70D.dll) : error LNK2005: "public: __thiscall std::basic_string::~basic_string(void)" (??1?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAE@XZ) already defined in Confetti.lib(ParticleSystem.obj) msvcprtd.lib(MSVCP70D.dll) : error LNK2005: "public: __thiscall std::basic_string::basic_string(char const *)" (??0?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAE@PBD@Z) already defined in Confetti.lib(ParticleSystem.obj) Can anyone tell me why this is happening and how to fix it? Also, if I ignore msvcprtd.lib, then I get lots of dll import/export errors for std::basic_string.
-
I have a non-MFC project using std::string that is compiled into a library (Confetti.lib). My main project is an MFC project that uses this library. I get the following linker errors: msvcprtd.lib(MSVCP70D.dll) : error LNK2005: "public: __thiscall std::basic_string::~basic_string(void)" (??1?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAE@XZ) already defined in Confetti.lib(ParticleSystem.obj) msvcprtd.lib(MSVCP70D.dll) : error LNK2005: "public: __thiscall std::basic_string::basic_string(char const *)" (??0?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAE@PBD@Z) already defined in Confetti.lib(ParticleSystem.obj) Can anyone tell me why this is happening and how to fix it? Also, if I ignore msvcprtd.lib, then I get lots of dll import/export errors for std::basic_string.