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 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) 中定义

解决办法

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

做如下改动,注意顺序

DEBUG:

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

RELEASE:

附加依赖库:uafxcw.lib;LIBCMT.lib;
忽略特定默认库:LIBCMT.lib;uafxcw.lib

作者:耑新新,发布于  博客园

转载请注明出处,欢迎邮件交流:[email protected]

原文地址:https://www.cnblogs.com/Arthurian/p/11962251.html

时间: 2024-08-17 00:35:18

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

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

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

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改成/

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

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写入就能够了:

VS2015+OpenGL4.0开发编译时弹出错误:glaux.lib(tk.obj) : error LNK2019: 无法解析的外部符号 _sscanf,该符号在函数 [email protected] 中被引用

一.问题描述: VS2015+OpenGL4.0开发编译时弹出如下所示的错误: 1>glaux.lib(tk.obj) : error LNK2019: 无法解析的外部符号 _sscanf,该符号在函数 [email protected] 中被引用 1>glaux.lib(tk.obj) : error LNK2019: 无法解析的外部符号 _vsprintf,该符号在函数 _PrintMessage 中被引用 二.问题原因: VS2015默认编译时将许多标准库采用内联方式处理,因而没有可以链