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 ...
随机推荐
- Simple tutorial for using TensorFlow to compute a linear regression
"""Simple tutorial for using TensorFlow to compute a linear regression. Parag K. Mita ...
- Linux:ssh_config快速访问服务器
在当前用户的根目录下: cd ~/.ssh vi config 编辑config内容为下面: ForwardAgent yes Host 1 Hostname 192.168.1.1 User roo ...
- 平述factory reset ——从main system到重引导流程
关于Android或linux的引导流程,网上大都是从开机开始讲述的,或者直接跳过bootloader引导阶段,直接从init进程开始说起.这里我从手机正常运行状态开始,到重启状态以及重启之后的状态略 ...
- Android性能优化之被忽视的优化点
对于性能优化这个知识点来说,实在是太广了,博主本人也一直非常关注这方面的学习,而对于性能优化来说它包括了非常非常非常多方面,比如:I/O的优化.网络操作的优化.内存的优化.数据结构的优化.代码层次的优 ...
- cocos2D v3.4 在TileMap中开启高清显示
在Tiled中制作一幅地图,用的图片砖块分辨率为32x32. iOS设备为iPhone 4s. 在未打开高清屏支持的cocos2d v2.x版本中,运行log显示480x320.遂启用高清屏支持: [ ...
- CentOS6 上OpenWRT交叉编译
目的不是为了编译固件,而是为了一个是编译可执行文件,放倒op的路由器上跑,另一个目的是安装一些开源软件折腾下(例如ss-lib),需要打包成 .ipk 格式 路由设备信息 erya@ERYA:~$ c ...
- Mybatis事务(一)事务管理方式
Mybatis管理事务是分为两种方式: (1)使用JDBC的事务管理机制,就是利用java.sql.Connection对象完成对事务的提交 (2)使用MANAGED的事务管理机制,这种机制mybat ...
- Linux之命令的组合
在Linux下有好多经典的操作,其中尤为经典的是命令的组合,不管是作为参数,还是命令之间的配合,都做得比较完善.下面看一下常用的一些命令吧. 1.连续运行多个命令就可以使用':'作为分隔,但是缺点就是 ...
- 【一天一道LeetCode】#61. Rotate List
一天一道LeetCode系列 (一)题目 Given a list, rotate the list to the right by k places, where k is non-negative ...
- Java应用服务器Resin
Resin是CAUCHO公司(http://www.caucho.com/)的产品,是一个非常流行的支持servlets 和jsp的引擎,速度非常快.Resin本身包含了一个支持HTTP/1.1的WE ...