DLL文件编译出错_DllMain@12 already defined in XXX.obj
2015-05-04 16:58
549 查看
编译MFC DLL程序时出现
Error
2 error LNK1169: one or more multiply defined symbols found
E:\C++\HookTest\CopyFileDetour\CFDetour\Debug\1t.dll
1 1t
1
Error 1
error LNK2005: _DllMain@12 already defined in 1t.obj
E:\C++\HookTest\CopyFileDetour\CFDetour\1t\mfcs100ud.lib(dllmodul.obj)
1t
1t为测试的dll工程名称
错误解决方法:
位置:Project->Propertie->C/C++->Preprocessor->Preprocessor Definitions
原句”WIN32;_DEBUG;_WINDOWS;_USRDLL;DATALOG_EXPORTS;%(PreprocessorDefinitions)“把里面_USRDLL删除掉就可以解决此问题。极有可能是加了#include <afx.h>引起这个问题的。
之后可能会出现
如下错误虽然不影响程序的编译运行
3
IntelliSense: #error directive: Please use the /MD switch for _AFXDLL builds
d:\vs2010c++\vc\atlmfc\include\afxver_.h
81 3
可以通过以下设置更改
Project ->Property->Configuration Properties->C/C++->Code Generation->Runtime
Library,在Runtime Library下选中Multithreaded DLL或Debug Multithreaded DLL。
Error
2 error LNK1169: one or more multiply defined symbols found
E:\C++\HookTest\CopyFileDetour\CFDetour\Debug\1t.dll
1 1t
1
Error 1
error LNK2005: _DllMain@12 already defined in 1t.obj
E:\C++\HookTest\CopyFileDetour\CFDetour\1t\mfcs100ud.lib(dllmodul.obj)
1t
1t为测试的dll工程名称
错误解决方法:
位置:Project->Propertie->C/C++->Preprocessor->Preprocessor Definitions
原句”WIN32;_DEBUG;_WINDOWS;_USRDLL;DATALOG_EXPORTS;%(PreprocessorDefinitions)“把里面_USRDLL删除掉就可以解决此问题。极有可能是加了#include <afx.h>引起这个问题的。
之后可能会出现
如下错误虽然不影响程序的编译运行
3
IntelliSense: #error directive: Please use the /MD switch for _AFXDLL builds
d:\vs2010c++\vc\atlmfc\include\afxver_.h
81 3
可以通过以下设置更改
Project ->Property->Configuration Properties->C/C++->Code Generation->Runtime
Library,在Runtime Library下选中Multithreaded DLL或Debug Multithreaded DLL。
相关文章推荐
- DLL文件编译出错_DllMain@12 already defined in XXX.obj
- 调试: 编译错误, mfcs42.lib(dllmodul.obj) : error LNK2005: _DllMain@12 already defined in MSVCRT.lib(dllmai
- error LNK2005: _DllMain@12 already defined in xxx.OBJ 解决办法
- error LNK2005: _DllMain@12 already defined in xxx.OBJ
- mfcs100d.lib(dllmodul.obj) : error LNK2005: _DllMain@12 already defined in MSVCRTD.lib(dllmain.obj)
- LNK2005: _DllMain@12 already defined in xxx.obj
- libcmtd.lib(crt0dat.obj) : error LNK2005: _exit already defined in msvcrtd.lib(MSVCRTD.dll) 编译错误解决方法
- mfcs100d.lib(dllmodul.obj) : error LNK2005: _DllMain@12 already defined in MSVCRTD.lib(dllmain.obj)
- error LNK2005: _DllMain@12 already defined in xxx.OBJ
- How to resolve '_DllMain@12 already defined in xxx.obj' ?
- mfcs80ud.lib(dllmodul.obj) : error LNK2005: _DllMain@12 already defined in MSVCRTD.lib(dllmain.obj)
- error LNK2005: _DllMain@12 already defined in xxx.OBJ
- : error LNK2005: _DllMain@12 already defined in dllmain.obj
- mfcs100d.lib(dllmodul.obj) : error LNK2005: _DllMain@12 already defined in MSVCRTD.lib(dllmain.obj)
- libcmtd.lib(crt0dat.obj) : error LNK2005: _exit already defined in msvcrtd.lib(MSVCRTD.dll) 编译错误解决方法
- mfcs90d.lib(xxx.obj):error LNK2005:_DllMain@12 already defined in MSVCRTD.lib(xxx.obj)
- error LNK2005: _DllMain@12 already defined in xxx.OBJ 解决办法
- error LNK2005: _DllMain@12 already defined in xxx.OBJ 解决办法
- nafxcw.lib(dllmodul.obj) : error LNK2005: _DllMain@12 already defined in解决办法
- uafxcwd.lib(dllmodul.obj) : error LNK2005: _DllMain@12 already defined in main.obj