Re: [GD-Windows] MFC and libc linker error
Brought to you by:
vexxed72
From: Joscha M. <jo...@re...> - 2002-04-30 15:19:28
|
Hi Jacob, you have to use the /nodefaultlib linker param. You have to specify the lib you don't want to include. In your= case it should be libcmtd. There is a different combination for each mfc/threading/debug combination. Look up in the msdn library for= more information. There is a whole section about this problem. Hope this helps Joscha Jacob wrote: >>Developing simple MFC app and it is all going fine, just added= a >>load of our >>common source files into the project and now getting the= following >>errors. >>nafxcwd.lib(afxmem.obj) : error LNK2005: "void * __cdecl= operator >>new(unsigned int)" (??2@YAPAXI@Z) already defined in >>LIBCMTD.lib(new.obj) >>nafxcwd.lib(afxmem.obj) : error LNK2005: "void __cdecl operator= >>delete(void >>*)" (??3@YAXPAX@Z) already defined in LIBCMTD.lib(dbgdel.obj) >>Now I have no idea why MSVC can't sort out which new to use, I= >>don't think I >>am explictly telling it to use the libc version ? >>I have had this before but can't remember how I fixed it. The= last >>time it >>happened I deleted all the source files and then added them in= 1 by >>1 and it >>all worked. I have tried doing that this time but to no= avail. |