错误重现:

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的更多相关文章

  1. 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 ...

  2. ZZmsvcprt.lib(MSVCP90.dll) : error LNK2005:已经在libcpmtd.lib(xmutex.obj) 中定义 .的分析解决办法 (转)

    很久没有写程式设计入门知识的相关文章了,这篇文章要来谈谈程式库 (Library) 连结,以及关于 MSVC 与 CRT 之间的种种恩怨情仇. 如果你使用的作业系统是 Linux.Mac 或其他非 W ...

  3. error LNK2005 int __cdecl 解决方案【转】

    error LNK2005: "int __cdecl isPtInPolygon(class std::vector<struct double2,class std::alloca ...

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

    编译错误提示: 1>afxnmcdd.lib(wincore2.obj) : error LNK2005: "void __stdcall DDX_Control(classCData ...

  5. (转+原)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) ...

  6. VC++常规错误之17:1>nafxcwd.lib(afxmem.obj) : error LNK2005

    VC++常规错误之17:1>nafxcwd.lib(afxmem.obj) : error LNK2005 (1)错误案例:在写日志程序中出现,工程是MFC程序(注:win32控制台应用程序,不 ...

  7. error LNK2005: “找到一个或多个多重定义的符号” 已经在 xxxx.obj 中定义 的解决方法

    1 问题还原 这里我有三个源文件:Base.hpp, Base.cpp 和 main.cpp 在Base.hpp里面定义一个基类,注意,基类只包含构造函数和析构函数的声明,函数在Base.cpp里实现 ...

  8. VC++ : error LNK2005: ... already defined in *.obj

    今天写代码遇到了这么一个链接错误:"已经在*.obj中定义". error LNK2005: "void __cdecl ReplaceWstringVar(class ...

  9. 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 ...

随机推荐

  1. 使用教程sqlite

    访问地址: http://www.runoob.com/sqlite/sqlite-where-clause.html

  2. cocos2d-x UserDefault

    转自:http://blog.csdn.net/yanghuiliu/article/details/6912612 正在做项目中有很多游戏数据要保存,常见的玩家数据这些比较简单的可以用CCUserD ...

  3. iOS8 CLLocationManager 、CLGeocoder获取地理位置

    最近在ios8.0使用CLLocationManager定位服务,发现老不能定位,查看设置菜单中的项也是处于未知状态.想起之前都有一个弹出框提示用户是否允许定位,这次一直没有出现了.原来ios8.0下 ...

  4. 区域医疗移动医疗影像解决方案2--基于FLEX的PACS

    基于Flex的PACS和基于HTML5的PACS,都不是基于DICOM的WADO的方式,即所有的图像操作,移动.缩放.旋转.测量.伪彩.窗宽窗位调整等都是在本地浏览器能够完成,不用和服务器进行频繁的交 ...

  5. C# Firefox Session Manager 文件的导出与管理

    长时间使用Firefox会产生很多的session文件(使用了插件:Session Manager).这些文件保存了你浏览过的所有的网址.虽然我们可以使用firefox的书签功能.但有时候打开的网址过 ...

  6. careercup-中等难度 17.9

    17.9 设计一个方法,找出任意指定单词在一本书中的出现频率. 解法: 1 单次查询 遍历这本书的每个单词,计算给定单词出现的次数.时间复杂度O(n),我们无法继续优化它,因为书中的每个单次都需要访问 ...

  7. android startActivityForResult(Intent intent, int requestCode) 整理与总结! .

    假设有两个Activity,主界面A,功能界面B,由A启动B,并传数据给B,B在经过处理后把数据传回给A. 先是A传B: Bundle bundle = new Bundle();bundle.put ...

  8. Android Studio编译FBReaderJ

    我的个人环境 系统:mac (windows应该差不多) 工具:android studio 2.1.2 注意:一定要安装NDK!一定要安装NDK!一定要安装NDK!     如何安装NDK     ...

  9. Fixflow引擎解析(三)(模型) - 创建EMF模型来读写XML文件

    Fixflow引擎解析(四)(模型) - 通过EMF扩展BPMN2.0元素 Fixflow引擎解析(三)(模型) - 创建EMF模型来读写XML文件 Fixflow引擎解析(二)(模型) - BPMN ...

  10. Ⅲ.spring的点点滴滴--赋值

    承接上文 对象的赋值(调用方式都一样不再阐述) .net篇(环境为vs2012+Spring.Core.dll v1.31) public class PropertyDemo{ public Sys ...