I just upgraded to Visual Studio 2008 from 2005 yesterday. Well, I'm trying to take advantage of some of the new classes (specifically CFrameWndEx) and I'm getting errors. Declaring a CFrameWndEx child class and then adding afxcmdiframewndex.h to stdafx.h gives me only one error. A seemingly harmless one at that. I just get the error that "COleDropTarget base class undefined". OK, simple fix, add afxole.h to my includes and it'll all be good. But after I do that is when all hell breaks loose. Everything in the output is good until linking:
1>LIBCMT.lib(sprintf.obj) : error LNK2005: _sprintf already defined in msvcrtd.lib(MSVCR90D.dll)
1>LIBCMT.lib(invarg.obj) : error LNK2005: __invoke_watson already defined in msvcrtd.lib(MSVCR90D.dll)
1>LIBCMT.lib(tidtable.obj) : error LNK2005: __encode_pointer already defined in msvcrtd.lib(MSVCR90D.dll)
1>LIBCMT.lib(tidtable.obj) : error LNK2005: __decode_pointer already defined in msvcrtd.lib(MSVCR90D.dll)
1>LIBCMT.lib(setlocal.obj) : error LNK2005: __configthreadlocale already defined in msvcrtd.lib(MSVCR90D.dll)
1>LIBCMT.lib(crt0dat.obj) : error LNK2005: __amsg_exit already defined in msvcrtd.lib(MSVCR90D.dll)
1>LIBCMT.lib(crt0dat.obj) : error LNK2005: __initterm_e already defined in msvcrtd.lib(MSVCR90D.dll)
1>LIBCMT.lib(crt0dat.obj) : error LNK2005: _exit already defined in msvcrtd.lib(MSVCR90D.dll)
1>LIBCMT.lib(crt0dat.obj) : error LNK2005: __exit already defined in msvcrtd.lib(MSVCR90D.dll)
1>LIBCMT.lib(crt0dat.obj) : error LNK2005: __cexit already defined in msvcrtd.lib(MSVCR90D.dll)
1>LIBCMT.lib(mlock.obj) : error LNK2005: __unlock already defined in msvcrtd.lib(MSVCR90D.dll)
1>LIBCMT.lib(mlock.obj) : error LNK2005: __lock already defined in msvcrtd.lib(MSVCR90D.dll)
1>LIBCMT.lib(winxfltr.obj) : error LNK2005: __XcptFilter already defined in msvcrtd.lib(MSVCR90D.dll)
1>LIBCMT.lib(strftime.obj) : error LNK2005: _strftime already defined in msvcrtd.lib(MSVCR90D.dll)
1>LIBCMT.lib(crt0init.obj) : error LNK2005: ___xi_a already defined in msvcrtd.lib(cinitexe.obj)
1>LIBCMT.lib(crt0init.obj) : error LNK2005: ___xi_z already defined in msvcrtd.lib(cinitexe.obj)
1>LIBCMT.lib(crt0init.obj) : error LNK2005: ___xc_a already defined in msvcrtd.lib(cinitexe.obj)
1>LIBCMT.lib(crt0init.obj) : error LNK2005: ___xc_z already defined in msvcrtd.lib(cinitexe.obj)
1>LIBCMT.lib(hooks.obj) : error LNK2005: "void __cdecl terminate(void)" (?terminate@@YAXXZ) already defined in msvcrtd.lib(MSVCR90D.dll)
1>LIBCMT.lib(errmode.obj) : error LNK2005: ___set_app_type already defined in msvcrtd.lib(MSVCR90D.dll)
1>msvcrtd.lib(MSVCR90D.dll) : error LNK2005: __setmbcp already defined in LIBCMT.lib(mbctype.obj)
1>LINK : warning LNK4098: defaultlib 'msvcrtd.lib' conflicts with use of other libs; use /NODEFAULTLIB:library
1>LINK : warning LNK4098: defaultlib 'LIBCMT' conflicts with use of other libs; use /NODEFAULTLIB:library
And using /NODEFAULTLIB to get rid of msvcrtd.lib and LIBCMT just caused a whole mess load of more problems. I would assume that one way of fixing this would be to find the libraries conflicting with msvcrtd.lib and LIBCMT, but how do I go about doing this?
Has anybody seen this problem before? It seems like a conflict with Microsoft code, but it's possible that it could be my code. Any help would be much appreciated.
Thanks in advance.