原创 error LNK2005: "void __cdecl operator delete

2010-11-9 16:58 9058 8 8 分类: 软件与OS
解决了一个问题

error LNK2005: "void __cdecl operator delete..解决

碰到了这个问题,栽网上找到了解决方案,如下所示:


VC缺省链接库的顺序不对导致链接错误error LNK2005: "void __cdecl operator delete(void *)"(??3@YAXPAX@Z) already defined in libcpmt.lib(delop.obj)

<div class="bvMsg" id="msgcns" !9e39842ffdc122cd!112>
在编译工程UDPDriver时,MFC static Library和Code Generation/MultiThread选项时,链接总出现问题:

nafxcw.lib(afxmem.obj) : error LNK2005: "void __cdecl operator delete(void *)" (??3@YAXPAX@Z) already defined in libcpmt.lib(delop.obj)
nafxcw.lib(afxmem.obj) : warning LNK4006: "void __cdecl operator delete(void *)" (??3@YAXPAX@Z) already defined in libcpmt.lib(delop.obj); second definition ignored

 

 

我个人的设置是这样的,跟网上的有点不一样(顺序不同)

1. 

project setting ---gategory --input ---ignorelibries 下面添加要忽略的那两个库本例为

nafxcw.lib libcpmt.lib

2.修改连接库的顺序

project setting ---gategory --general ---object/library modules:

添加  Libcmtd.lib Nafxcwd.lib  (这两个lib顺序不一样,如果还是不行  就改成

Nafxcwd.lib  Libcmtd.lib )

 

解决

文章评论0条评论)

登录后参与讨论
我要评论
0
8
关闭 站长推荐上一条 /2 下一条