When I added the following line to my code:
std::string sFrameTag
I got the following linker error:
Error 34 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 VFPAnalyzerApi.lib(VFPEvaluation.obj) msvcprtd.lib
I took a look at the project properties, under C/C++ -> code generation -> runtime Library and changed it from /MDd
to /MD
and somehow the error disappeared.. However, I don't really understand what's the difference and why it worked. Can someone please explain what exactly have I changed and why it made a difference?
Thanks!!!
MSDN has good docs on this.
In short, /MDd
links the necessary parts of a debug build of the C & C++ standard libraries into your DLL. /MD
is similar but uses a NDEBUG
version of the standard libraries. If you try to link code that combines debug and release standard libraries, you'll get symbol clashes as both libraries will provide the same set of functions.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With