LNK1169 和 LNK2005
错误重现:
1> vs2010创建 C++ win32 project, Application type: DLL.
2>为了在工程中使用 CString, 在 stdafx.h 中 Include <afx.h>.
3> 编译工程,编译结果如下:LNK1169 和 LNK2005

在网上找到一篇文章很详细的解释了这种现象的前因后果:
[随感]fatal error LNK1169: one or more multiply defined symbols found终极解决
下面是微软提供的一个解决方案:
Microsoft support: A LNK2005 error occurs when the CRT library and MFC libraries are linked in the wrong order in Visual C++
下面我就总结列出在vs2010中解决这些错误的具体操作:
方案1> Project property -> Configuration Properties -> Linker/General/Force File Output
选择 “Multiply Defined Symbol Only (/FORCE:MULTIPLE)”。

方案2> Project property -> Configuration Properties -> Linker/Command Line
将 /FORCE:MULTIPLE 加入到 Additional Options 里。

LNK1169 和 LNK2005的更多相关文章
- win32 Dll 中添加afx.h 出现如下错误 error LNK2005: _DllMain@12 already defined
win32 Dll 中添加afx.h 出现如下错误 nafxcwd.lib(dllmodul.obj) : error LNK2005: _DllMain@12 already defined in ...
- ZZmsvcprt.lib(MSVCP90.dll) : error LNK2005:已经在libcpmtd.lib(xmutex.obj) 中定义 .的分析解决办法 (转)
很久没有写程式设计入门知识的相关文章了,这篇文章要来谈谈程式库 (Library) 连结,以及关于 MSVC 与 CRT 之间的种种恩怨情仇. 如果你使用的作业系统是 Linux.Mac 或其他非 W ...
- error LNK2005 int __cdecl 解决方案【转】
error LNK2005: "int __cdecl isPtInPolygon(class std::vector<struct double2,class std::alloca ...
- error LNK2005: DDX_Control 已经在 uafxcwd.lib(wincore2.obj) 中定义
编译错误提示: 1>afxnmcdd.lib(wincore2.obj) : error LNK2005: "void __stdcall DDX_Control(classCData ...
- (转+原)VC编译错误:uafxcw.lib(afxmem.obj) : error LNK2005: "void * __cdecl operator new(unsigned int)" (??2@YAPAXI@Z) 已经在 LIBCMT.lib(new.obj) 中定义
参考网址:http://zhanyonhu.blog.163.com/blog/static/16186044201023094754832/ 1>uafxcw.lib(afxmem.obj) ...
- VC++常规错误之17:1>nafxcwd.lib(afxmem.obj) : error LNK2005
VC++常规错误之17:1>nafxcwd.lib(afxmem.obj) : error LNK2005 (1)错误案例:在写日志程序中出现,工程是MFC程序(注:win32控制台应用程序,不 ...
- error LNK2005: “找到一个或多个多重定义的符号” 已经在 xxxx.obj 中定义 的解决方法
1 问题还原 这里我有三个源文件:Base.hpp, Base.cpp 和 main.cpp 在Base.hpp里面定义一个基类,注意,基类只包含构造函数和析构函数的声明,函数在Base.cpp里实现 ...
- VC++ : error LNK2005: ... already defined in *.obj
今天写代码遇到了这么一个链接错误:"已经在*.obj中定义". error LNK2005: "void __cdecl ReplaceWstringVar(class ...
- LNK1169: one or more multiply defined symbols found
The build failed due to multiple definitions of one or more symbols. This error is preceded by error ...
随机推荐
- SUSE的SSHD配置及设置防火墙
国内私募机构九鼎控股打造APP,来就送 20元现金领取地址:http://jdb.jiudingcapital.com/phone.html内部邀请码:C8E245J (不写邀请码,没有现金送)国内私 ...
- js 如何把JSON格式的字符串转换为JSON对象
直接用eval函数.例:var str1 = '{ "url": "www.51qdq.com", "name": "js&quo ...
- hdu 5465 Clarke and puzzle 二维线段树
Clarke and puzzle Time Limit: 1 Sec Memory Limit: 256 MB 题目连接 http://acm.hdu.edu.cn/showproblem.php? ...
- git在windows下clone、pull或者push内存溢出的解决办法
发现国内使用git来真正管理源码的人不多,特别是大数据量的源码,今天使用git clone android的源码时突然出现remote out of memery,解决办法: git config - ...
- [Whole Web] [Node.js] Using npm run to launch local scripts
npm run allows you to configure scripts inside of your package.json file which can access locally in ...
- android119 侧滑菜单
MainActivity.java package com.heima52.slidemenu; import com.heima52.slidemenu.view.SlideMenu; import ...
- Mysql shell 控制台---mysqlsh
原创 2016-07-12 杜亦舒 性能与架构 以前登录Mysql的控制台后,使用SQL语言来操作数据库,如 mysql> select * from tablename; Mysql 5.7. ...
- STL——内存基本处理工具
STL定义有五个全局函数,作用于未初始化空间上,这样的功能对于容器的实现很有帮助.前两个函数是用于构造的construct()和用于析构的destroy(),另三个函数是uninitialized_c ...
- 用linq实现登陆功能
BLL层的逻辑代码 using System; using System.Collections.Generic; using System.Linq; using System.Text; name ...
- Java读取文本文件中文乱码问题 .转载
最近遇到一个问题,Java读取文本文件(例如csv文件.txt文件等),遇到中文就变成乱码.读取代码如下: List<String> lines=new ArrayList<Stri ...