错误LNK2005:_DllMain @ 12已在dllmain.obj mfcs90ud.lib中定义 [英] error LNK2005: _DllMain@12 already defined in dllmain.obj mfcs90ud.lib

查看:306
本文介绍了错误LNK2005:_DllMain @ 12已在dllmain.obj mfcs90ud.lib中定义的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个静态的lib文件及其对应的头文件...
现在正在尝试通过为静态lib中的函数编写包装函数来开发dll
现在我面对上面的链接器错误

项目设置:

在共享DLL中使用MFC
多线程调试DLL(/MDd)
忽略特定的库:uafxcwd.lib

I have a static lib file and it''s corresponding header files...
now am trying to develop dll by writing a wrapper function for the functions in static lib
and now i am facing the above linker error

Project setting:

Use MFC in a Shared DLL
Multi-threaded Debug DLL (/MDd)
Ignore specific library : uafxcwd.lib

推荐答案

通常,您将标头包装如下:
Normally you wrap the header like this:
#ifndef filename_h
#define filename_h
        statement sequence
#endif



这样可以防止多个夹杂物.

祝你好运!



This will prevent multiple inclusions.

Good luck!


这篇关于错误LNK2005:_DllMain @ 12已在dllmain.obj mfcs90ud.lib中定义的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆