1>uafxcwd.lib(afxmem.obj) : error LNK2005: "void * __cdecl operator new(unsigned __int64)" (??2@YAPEAX_K@Z) 已在 LIBCMTD.lib(new.obj) 中定義過了
1>uafxcwd.lib(afxmem.obj) : error LNK2005: "void __cdecl operator delete(void *)" (??3@YAXPEAX@Z) 已在 LIBCMTD.lib(dbgdel.obj) 中定義過了
1>uafxcwd.lib(afxmem.obj) : error LNK2005: "void * __cdecl operator new[](unsigned __int64)" (??_U@YAPEAX_K@Z) 已在 libcpmtd.lib(newaop.obj) 中定義過了
1>uafxcwd.lib(afxmem.obj) : error LNK2005: "void __cdecl operator delete[](void *)" (??_V@YAXPEAX@Z) 已在 LIBCMTD.lib(delete2.obj) 中定義過了
查閱資料,找到解決方法,在project -> Properties -> Linker -> Command Line中添加/force命令,重新build沒有錯誤。
雖然有警告:
Finished generating code
1>uafxcw.lib(afxmem.obj) : warning LNK4006: "void * __cdecl operator new(unsigned __int64)" (??2@YAPEAX_K@Z) already defined in LIBCMT.lib(new.obj); second definition ignored
1>uafxcw.lib(afxmem.obj) : warning LNK4006: "void __cdecl operator delete(void *)" (??3@YAXPEAX@Z) already defined in LIBCMT.lib(delete.obj); second definition ignored
1> : warning LNK4088: image being generated due to /FORCE option; image may not run
但是可以運行。
但是為什麼這麼改,自己還是不太清楚。
ref:
http://blog.csdn.net/liyun123gx/article/details/23194189
留言列表