error LNK2005: operator new already defined in LIBCMT.lib
Posted on 2000-04-24
I'm trying to compile my static MFC multithreaded app and keep getting the linker error:
nafxcw.lib(afxmem.obj) : error LNK2005: "void * __cdecl operator new(unsigned int)" (??2@YAPAXI@Z) already defined in LIBCMT.lib(new.obj)
nafxcw.lib(afxmem.obj) : error LNK2005: "void __cdecl operator delete(void *)" (??3@YAXPAX@Z) already defined in LIBCMT.lib(delete.obj)
Found "public: void * __thiscall
I put the linker to verbose and verified it is finding the new operator in both nafxcw.lib and libcmt.lib.
Any ideas how to correct this? work arounds?
BTW-Using MFC and STL, everything static linked.