uafxcwd.lib(afxmem.obj) : error LNK2005: "void * __cdecl operator new(unsigned int)"解决办法

如果在编译MFC程序的时候出现下列及类似的错误:

1>uafxcwd.lib(afxmem.obj) : error LNK2005: "void * __cdecl operator new(unsigned int)" ([email protected]@Z) 已经在 LIBCMTD.lib(new.obj) 中定义
1>uafxcwd.lib(afxmem.obj) : error LNK2005: "void __cdecl operator delete(void *)" ([email protected]@Z) 已经在 LIBCMTD.lib(dbgdel.obj) 中定义
1>uafxcwd.lib(afxmem.obj) : error LNK2005: "void * __cdecl operator new[](unsigned int)" ([email protected]@Z) 已经在 libcpmtd.lib(newaop.obj) 中定义
1>uafxcwd.lib(afxmem.obj) : error LNK2005: "void __cdecl operator delete[](void *)" ([email protected]@Z) 已经在 LIBCMTD.lib(delete2.obj) 中定义

解决方法如下:

项目属性页-》链接器-》输入

做如下改动,注意顺序

附加依赖库:uafxcwd.lib;LIBCMTD.lib;
忽略特定默认库:LIBCMTD.lib;uafxcwd.lib

时间: 2024-08-01 10:45:24

uafxcwd.lib(afxmem.obj) : error LNK2005: "void * __cdecl operator new(unsigned int)"解决办法的相关文章

MFC程序出现uafxcwd.lib(afxmem.obj) : error LNK2005: "void * __cdecl operator new(unsigned int)解决办法

在同一个地方摔倒两次之后,决定记录下来这个东西. 问题 1>uafxcwd.lib(afxmem.obj) : error LNK2005: "void * __cdecl operator new(unsigned int)" ([email protected]@Z) 已经在 LIBCMTD.lib(new.obj) 中定义1>uafxcwd.lib(afxmem.obj) : error LNK2005: "void __cdecl operator del

error LNK2005: "void * __cdecl operator new(unsigned int)" ([email protected]@Z) 已经在 LIBCMTD.lib(new.obj) 中

在编译文章: 使用GetAdaptersAddresses函数获取物理MAC地址中的代码时,出现以下错误: 错误 1 error LNK2005: "void * __cdecl operator new(unsigned int)" ([email protected]@Z) 已经在 LIBCMTD.lib(new.obj) 中定义 F:\CcProjects\获取网卡物理地址MAC地址\获取网卡物理地址MAC地址\uafxcwd.lib(afxmem.obj) 获取网卡物理地址MA

uafxcwd.lib(afxmem.obj) : error LNK2005 解决方法

项目为非MFC,但要用到MFC的库,使用过程中遇到的问题总结一下 uafxcwd.lib(afxmem.obj) : error LNK2005: "void * __cdecl operator new(unsigned int)" ([email protected]@Z) already defined in LIBCMTD.lib(new.obj)uafxcwd.lib(afxmem.obj) : error LNK2005: "void __cdecl operat

VC编译错误:msvcrtd.lib(ti_inst.obj) : error LNK2005: "private: __thiscall type_info::t.... 已经在 libcmtd.lib(typinfo.obj) 中定义

1>msvcrtd.lib(ti_inst.obj) : error LNK2005: "private: __thiscall type_info::type_info(class type_info const &)" ([email protected]@[email protected]@@Z) 已经在 libcmtd.lib(typinfo.obj) 中定义1>msvcrtd.lib(ti_inst.obj) : error LNK2005: "

error LNK2005: DDX_Control 已经在 uafxcwd.lib(wincore2.obj) 中定义

编译错误提示: 1>afxnmcdd.lib(wincore2.obj) : error LNK2005: "void __stdcall DDX_Control(classCDataExchange *,int,class CWnd &)" ([email protected]@[email protected]@[email protected]@@Z)already defined in nafxcwd.lib(wincore2.obj) 1>afxnmcdd

2>MSVCRTD.lib(MSVCR100D.dll) : error LNK2005: _calloc 已经在 LIBCMTD.lib(dbgcalloc.obj) 中定义

使用VS2010,在FireBreath里面调用ortp库和Speex库.编译的时候出现错误: 2>MSVCRTD.lib(MSVCR100D.dll) : error LNK2005: _calloc 已经在 LIBCMTD.lib(dbgcalloc.obj) 中定义 事实上有非常多类似的打印. "属性"->"链接器"->"输入"->"忽略特定默认库" 将LIBCMTD.lib写入就能够了:

【转】strmbasd.lib(dllentry.obj) : error LNK2001: 无法解析的外部符号"int g_cTemplates"

加入了DirectShow的基类链接库后,如果此时编译就会出现以下编译错误: strmbasd.lib(wxutil.obj) : error LNK2019: 无法解析的外部符号 [email protected] strmbasd.lib(wxutil.obj) : error LNK2019: 无法解析的外部符号 [email protected] strmbasd.lib(dllentry.obj) : error LNK2001: 无法解析的外部符号 "class CFactoryTe

vs2015编译ffmpeg 出现错误rtmp.lib(rtmp.obj) : error LNK2001: 无法解析的外部符号 ___iob_func

vs2015编译ffmpeg(版本3.0.2)引用外部库文件librtmp出现以下错误: rtmp.lib(rtmp.obj) : error LNK2001: 无法解析的外部符号 __imp__strtod rtmp.lib(rtmp.obj) : error LNK2001: 无法解析的外部符号 __imp__sscanf rtmp.lib(rtmp.obj) : error LNK2001: 无法解析的外部符号 __imp___snprintf rtmp.lib(rtmp.obj) : e

LIBCD.lib(crt0.obj) : error LNK2001: unresolved external symbol _main

在创建MFC项目时,如果没有设置好项目参数, 就会在编译时产生很多连接错误, 如我今天遇到的: LIBCD.lib(crt0.obj) : error LNK2001: unresolved external symbol _main 解决方法: 控制台项目要使用windows子系统, 而不是console, 设置:[Project] --> [Settings] --> 选择"Link"属性页,在Project Options中将/subsystem:console改成/