I am trying to compile my Visual C++ project (uses MFC) in Microsoft Visual Studio 2012, and it comes back with the following errors:
error LNK2005: "void * __cdecl operator new(unsigned int)" (??2@YAPAXI@Z) already defined in LIBCMTD.lib(new.obj)
error LNK2005: "void __cdecl operator delete(void *)" (??3@YAXPAX@Z) already defined in LIBCMTD.lib(dbgdel.obj)
error LNK2005: "void __cdecl operator delete[](void *)" (??_V@YAXPAX@Z) already defined in LIBCMTD.lib(delete2.obj)
error LNK1169: one or more multiply defined symbols found
So I googled around a bit and found this page:
http://support.microsoft.com/?scid=kb%3Ben-us%3B148652&x=13&y=8
I tried solution one but the “Ignore Libraries” box does not exist, and so does the Object/library modules box. For the Ignore Libraries I found Ignore specific libraries, but skipping step five only gave me 17xx errors.
I googled around a lot, but always came back to the same page, how can I fix this problem in Visual Studio 2012?
I fixed the problem: I found that it is a problem with the order of the includes. However forcing every file to have the afx.h include (properties->c/c++/advanced/force include file)
fixed the problem for me.