在Relese模式下,在共享DLL中使用MFC无法正常工作
问题描述:
hii all
当我在共享Dll"中设置使用MFC"时,程序在Relese模式下崩溃.在静态库中使用使用MFC"功能完全起作用.
可以帮帮我吗
hii all
when i set Use MFC in a Shared Dll the Programe is crash on Relese mode.Using Use MFC in a Static Library It is working corectly.
Can ay one help me
答
切换此类型的项目设置后,确保对项目的每个配置进行完全重建很重要.包括您可能正在使用的其他静态库. MFC为这些项目设置定义了不同的符号,它们将对编译期间生成的目标代码产生影响.还要检查以确保您的应用程序正在加载的其他DLL也没有在共享DLL中使用MFC.我可能是错的,但是我认为这也是不兼容的.
After you switch this type of project setting, it is important to ensure that you do a complete rebuild of each configuration for your project. Including other static libraries that you may be using. There are different symbols #defined by MFC for these project settings and that will effect a difference on the object code produced during compilation. Also check to ensure that no other DLL that your application is loading, uses MFC in a shared DLL as well. I might be wrong, but I think this is incompatable as well.
如果将另一个库绑定到也使用MFC的项目,则该库必须使用相同的绑定(动态或静态) )作为您自己的项目.当我将项目从VS 2003迁移到VS 2010时,我发现在VS 2003中这不是问题,但是在VS 2010中是一个问题!
If you bind another library to your project that also uses MFC, then this library must use the same binding (dynamic or static) as your own project. When I migrated a project from VS 2003 to VS 2010 I found that in VS 2003 this was not a problem, but in VS 2010 it was!