mfc 扩展dll是动态链接还是静态链接mfc

「已注销」 2007-10-11 05:54:58
开发环境vss2005 vc
为了导出一个对话框,创建了一个mfc扩展dll,因为部署环境要求所有组件必须使用静态链接mfc,但是一选择静态链接mfc dll,就出现
d:\program files\microsoft visual studio 8\vc\atlmfc\include\afxver_.h(77) : fatal error C1189: #error :  Please use the /MD switch for _AFXDLL builds

根据提示在C++->code generation->runtime library改了MD之后,就出现
d:\program files\microsoft visual studio 8\vc\atlmfc\include\afx.h(24) : fatal error C1189: #error :  Building MFC application with /MD[d] (CRT dll version) requires MFC shared dll version. Please #define _AFXDLL or do not use /MD[d]

叫我如何是好.

另外,回顾创建向导中,Regular dll是可以创建两种:静态链接mfc和动态链接mfc的,而扩展dll则没有选择,是否说明这种dll必须是某种链接方式呢?

望达人指教!
...全文
342 8 打赏 收藏 转发到动态 举报
写回复
用AI写文章
8 条回复
切换为时间正序
请发表友善的回复…
发表回复
codediscuss 2007-10-13
  • 打赏
  • 举报
回复
为什么扩展的MFC dll工程必须要用shared MFC
http://www.codediscuss.com/mfc/extersion-mfc-dll-project-shared-mfc/
禽兽v5 2007-10-12
  • 打赏
  • 举报
回复
尽量不要静态链接,文件为非常大。
kugou123 2007-10-12
  • 打赏
  • 举报
回复
mfc扩展DLL,需要在其他工程导入lib,#include 动态库的头文件,DLL放置在工程目录中。这样就可以用了
liuxiuk 2007-10-12
  • 打赏
  • 举报
回复
动态连接

-----

把lib导入Directories...

或者你写dll的时候
dll输出路径直接指定到vc的目录下..
「已注销」 2007-10-12
  • 打赏
  • 举报
回复
msdn上的解释:
Extension DLLs are built using the dynamic-link library version of MFC (also known as the shared version of MFC). Only MFC executables (either applications or regular DLLs) that are built with the shared version of MFC can use an extension DLL. Both the client application and the extension DLL must use the same version of MFCx0.dll.

oyljerry 2007-10-12
  • 打赏
  • 举报
回复
放到程序安装目录就可以...
带上mfc,crt等相关的库
「已注销」 2007-10-12
  • 打赏
  • 举报
回复
那都需要同事发布哪些东西呢,放在程序所在目录就可以吗
leechiyang 2007-10-11
  • 打赏
  • 举报
回复
没有试过,看样子是这样,只能动态链接了,不过,你可以选择用VS6来开发你的DLL,98以上的windows都有vc6的DLL。
如果用vs2005,在发布程序的时候把动态链接库打进去就行了。

15,471

社区成员

发帖
与我相关
我的任务
社区描述
VC/MFC 进程/线程/DLL
社区管理员
  • 进程/线程/DLL社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧