User forums > Help
[RESOLVED] double definition of library and linker option : LNK2005
(1/1)
antonien:
Compiling my program, I run through 50+ errors of this kind :
--- Code: ---MSVCRTD.lib(MSVCR100D.dll) : error LNK2005: _fclose already defined in LIBCMTD.lib(fclose.obj)
--- End code ---
I did a search on this forum and found an interesting topic on it here.
It says that I have to put a /NODEFAULTLIB:LIBC command in the linker options. I guess in my case it'll be /NODEFAULTLIB:LIBCMTD...
The problem is : I can't figure out where to put it : is it in the build options ? in the compiler & debugger settings ? In category ?
Thanks in advance for your answer.
Best regards
antonien:
OK, I got it, it's in the other linker options just on the right of the linker settings.
But now I have another bunch of warnings :
--- Code: ---msvcprtd.lib(MSVCP100D.dll) : error LNK2005: "void __cdecl std::_Xlength_error(char const *)"
(?_Xlength_error@std@@YAXPBD@Z) already defined in libcpmtd.lib(xthrow.obj)
--- End code ---
I guess I have to do the same with libcpmtd.lib ?
antonien:
Uh ! I did it, and now I have this kind of warnings :
--- Code: ---msvcprtd.lib(MSVCP100D.dll) : error LNK2005: "public: __thiscall std::_Container_base12::~_Container_base12(void)"
(??1_Container_base12@std@@QAE@XZ) already defined in Ecranbleu.obj
--- End code ---
It looks like I simply moved the error from one point to another one !
Anybody can give me a cue ?
Thanks in advance.
antonien:
Well... digging more deeply into the forum, I read something about multithreaded static and dynamic libraries.
I had my project rebuilt in dynamic. I went for static because I couldn't buid a DLL based version of wxWidgets... obviously, it has nothing to do with that and I didn't cach the point.
Now it compiles. At least, I have more common errors and I close this topic 8)
Navigation
[0] Message Index
Go to full version