VS报错 error LNK2005: _DllMain@12 已经在 MSVCRTD.lib(dllmain.obj) 中定义
symbols "_USRDLL" and "_WINDLL" must be defined. Your DLL code must also
be compiled with the following compiler switches:
"_USR DLL" and"_WINDLL" must be defined. Your DLL code must also be
compile dwith the following compiler switches:
define t he above symbols and use the above compilerswitches.
Additionally, the sy mbol "_AFXDLL" must be definedand your DLL code
must be compiled with:
beexplicitlyexported. It is recommended that you define your interfaces
to be lowbandw idth, sticking to C interfaces where possible. More
direct C interfaces areeasi er to maintain than more
complex C++ classes.
and C++files (that way you won'tlimit your DLL customers to C++
programmers). Se e the header ScreenCap.h in theMFC Advanced Concepts
sample DLLScreen Cap for an example. To export yourfunctions,
enter them in theEXPORTSs ection of your moduledefinition file (.DEF)
or include__declspec(dllexpor t)on yourfunction definitions.
Use__declspec(dllimport)to import thesefunctions into the client
executable.
xportedfunctions in regular DLLs that dynamically link to MFC to set
the curr ent modulestate to the one for the DLL. This is done by adding
the followingline of codeto the beginning of
functions exported from the DLL:
initializ es yourCWinAppderived object as in a normal MFC application.
Placeall DLL-specific initialization in theInitInstancememberfunction as
in a normal MFC application.
VC2005解决办法:
1)Debug版本:
项目-属性-链接器-输入:忽略特定库中输入mfc80d.lib;mfcs80d.lib
项目-属性-链接器-附加依赖项:mfc80d.lib;mfcs80d.lib
就可以保证mfc80d和mfcs80d先于MSVCRTD.lib链接,OK,成功
2)Release版本
与Debug版本不同在于mfc80.lib;mfcs80.lib
VS报错 error LNK2005: _DllMain@12 已经在 MSVCRTD.lib(dllmain.obj) 中定义的更多相关文章
- error LNK2005: _DllMain@12 已经在 MSVCRTD.lib(dllmain.obj) 中定义
备注:我上次遇到这个问题是Win32 DLL项目中无意中include了afxwin.h,这个是MFC的头文件,把这个include删掉就解决了 ================ 转自:http:// ...
- (原)ippicvmt.lib(ippinit.obj) : error LNK2005: _ippSetCpuFeatures@8 已经在 ippcoremt.lib(ippinit.obj) 中定义
转载请注明出处: http://www.cnblogs.com/darkknightzh/p/5497234.html 参考网址: http://answers.opencv.org/question ...
- ZZmsvcprt.lib(MSVCP90.dll) : error LNK2005:已经在libcpmtd.lib(xmutex.obj) 中定义 .的分析解决办法 (转)
很久没有写程式设计入门知识的相关文章了,这篇文章要来谈谈程式库 (Library) 连结,以及关于 MSVC 与 CRT 之间的种种恩怨情仇. 如果你使用的作业系统是 Linux.Mac 或其他非 W ...
- libcmt.lib(crt0dat.obj) : error LNK2005: _amsg_exit 已经在 MSVCRTD.lib(MSVCR110D.dll) 中定义
问题描述(VC2012): 1>MSVCRTD.lib(cinitexe.obj) : warning LNK4098: 默认库"libcmt.lib"与其他库的使用冲突:请 ...
- error LNK2005: _DllMain@12 已经在 dllmain.obj 中定义
error LNK2005: _DllMain@ 已经在 dllmain.obj 中定义 今天遇到了同样的问题,搜索搜到了这里,后来解决了........ 创建解决方案时,用的是WIN32 DLL,添 ...
- 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 ...
- 封装dll遇到的奇葩错误:error LNK2005: _DllMain@12 已经在 DLLMain.obj 中定义
在定义一个dll工程的时候,一添加MFC的头文件就会报出这个 错误:error LNK2005: _DllMain@12 已经在 DLLMain.obj 中定义 既蛋疼又蛋疼!! 然后逛论坛,查资料 ...
- VC编译错误: Nafxcwd.lib(dllmodul.obj) : error LNK2005: _DllMain@12已经在dllmain.obj 中定义
错误: Nafxcwd.lib(dllmodul.obj) : error LNK2005: _DllMain@12已经在dllmain.obj 中定义 解决: 打开项目属性对话框, C/C++ -& ...
- mfcs100d.lib(dllmodul.obj) : error LNK2005: _DllMain@12 already defined in MSVCRTD.lib(dllmain.obj)
转自VC错误:http://www.vcerror.com/?p=55 问题描述: mfcs100d.lib(dllmodul.obj) : error LNK2005: _DllMain@12 al ...
随机推荐
- java设计模式---三种工厂模式
工厂模式提供创建对象的接口. 工厂模式分为三类:简单工厂模式(Simple Factory), 工厂方法模式(Factory Method)和抽象工厂模式(Abstract Factory).GOF在 ...
- svn 回退/更新/取消至某个版本命令详解
1. 取消Add/Delete 取消文件 svn revert 文件名 取消目录 svn revert --depth=infinity 目录名 2. 回退版本 方法1: 用svn merge 1) ...
- Java的字符串分割的不同实现
在java中实现字符串的分割相对而言是很简单的.我们一般会采取两中方式.一个是从jdk1.1就开始的StringTokenizer类,另一个是调用split方法进行分割.下面请看代码: import ...
- 《java入门第一季》集合框架引入与面试题
注:在开始的几篇集合介绍里,不包含泛型的概念.泛型在讲述所有集合后再加入进去. 集合的由来: 我们学习的是面向对象语言,而面向对象语言对事物的描述是通过对象体现的,为了方便对多个对象进行操作,我 ...
- AngularJS进阶(三十七)IE浏览器兼容性后续
IE浏览器兼容性后续 前言 继续尝试解决IE浏览器兼容性问题,结局方案为更换jquery.angularjs.IE的版本. 1.首先尝试更换jquery版本为1.7.2 jquery-1.9.1.js ...
- Python进阶 函数式编程和面向对象编程等
函数式编程 函数:function 函数式:functional,一种编程范式.函数式编程是一种抽象计算机的编程模式. 函数!= 函数式(如计算!=计算机) 如下是不同语言的抽象 层次不同 高阶函数: ...
- Locally Weighted Linear Regression 局部加权线性回归-R实现
局部加权线性回归 [转载时请注明来源]:http://www.cnblogs.com/runner-ljt/ Ljt 作为一个初学者,水平有限,欢迎交流指正. 线性回归容易出现过拟合或欠拟合的问 ...
- Unity3D学习笔记(二)Unity的JavaScript基础
Update()每帧调用一次LateUpdate()在Update()后执行Awake()系统执行的第一个方法Start()在Awake()之后,Update()之前FixedUpdate()固定更新 ...
- SpriteBuilder添加的TrueType字体未显示在log中的原因分析
按照书上的说法,在SpriteBuilder中添加的TrueType字体名称会在枚举字体方法显示的log中出现.但是运行程序后没有在log中发现对应的字体名称. 因为该字体是例子中作者制作的,所以字体 ...
- PostgreSQL两种分页方法查询时间比较
数据库中存了3000W条数据,两种分页查询测试时间 第一种 SELECT * FROM test_table WHERE i_id> limit 100; Time: 0.016s 第二种 SE ...