January 10th, 2010, 07:15 PM
I have a C++ project that has been compiling and linking without problems. Recently we added code to override the global new and delete operators and now the project fails to link with the error: error LNK2005: "void * __cdecl operator new(unsigned int)" (??2@YAPAXI@Z) already defined. I have spent a lot of time googling this problem and trying anything that is suggested. I am also aware of MS KB148652 and have done what it suggested -- I've placed Nafxcwd.lib and Libcmtd.lib in the Additional Dependencies and Ignore Specific Libary lists. Actually they were already there since I had to add them to eliminate other previous linker errors. I've made sure that the first include in all .cpp files is stdafx.h (as KB148652 suggests) but nothing seems to work. If anyone can suggest another approach or some direction I haven't tried I'd appreciate knowing about it. Thanks in advance.
Tags for this Thread
Click Here to Expand Forum to Full Width