I keep having linker errors of the following form:
libcmtd.dll msvmrtd.dll some element(ex: _mkdir ) already defined...
and I don't know how to resolve them.
Here is a complete error message:
private: __thiscall type_info::type_info(class type_info const &)" (??0type_info@@AAE@ABV0@@Z) already defined in LIBCMTD.lib(typinfo.obj)
MSVCRTD.lib(ti_inst.obj) : error LNK2005: "private: class type_info & __thiscall type_info::operator=(class type_info const &)" (??4type_info@@AAEAAV0@ABV0@@Z) already defined in LIBCMTD.lib(typinfo.obj)
Can you help me solve this issue?
The unresolved external symbol is a linker error that indicates it cannot find the symbol or its reference during the linking process. The error is similar to “undefined reference” and is issued interchangeably.
Check a few things:
Are your header files guarded. I.e. do they have #ifndef
guards.
Are you defining (non-template) functions in headers without the inline
keyword. That messes lots of stuff up.
Are you trying to define templates in a .cpp file. All template definitions need to be in headers.
Post some code and exact error text please!
Your problem is that you're linking with two files providing the same symbol.
You haven't provided the real error message so we can't tell you exactly what the problem is but it's likely to be that you're linking with libraries from two different versions of Visual Studio.
There are also solutions available by searching the web (I assume you did this but just missed the articles in question :-) that suggest you can fix the problem by changing the project options from "Multi-threaded Debug(/MTd)"
to "Multi-threaded Debug DLL (/MTD)"
but I haven't looked in to this.
Please post the complete error so we can offer more targeted assistance.
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