将发布 dll 与调试主应用程序 exe 混合 [英] Mixing release dlls with debug main application exe

查看:33
本文介绍了将发布 dll 与调试主应用程序 exe 混合的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

假设我有一个 Visual C++ 应用程序,它有一个主要的可执行文件和许多 dll.我有 2 个配置发布和调试.

Suppose I've one visual c++ application which is having a main executable and many dlls. I have 2 configuration release and debug.

我只是想知道使用 mix 可能产生什么效果,我的意思是使用 debug dll with release main exe 或 debug exe with release dlls.

I just want to know what will be possible effect of using mix, I mean using using debug dll with release main exe or debug exe with release dlls.

谢谢

推荐答案

我认为主要的潜在问题是 DLL 不会使用与可执行文件相同的运行时库.

I think the main potential problem would be that the DLLs won't be using the same runtime library as the executable.

这意味着您不能共享运行时对象(例如文件描述符),并且您不能在其中一个分配内存并在另一个中释放它 - 尽管如果您遵循最佳实践并且始终免费,这不会成为问题来自分配它的同一模块的内存.

That means that you can't share runtime objects such as file descriptors, and you can't allocate memory in one and release it in the other - although this won't be a problem if you follow best practice and always free memory from the same module it was allocated from.

如果您在 DLL 和可执行文件之间共享非 POD(例如类的实例),也可能会出现问题.我不确定类实例是否保证在调试和发布之间是二进制兼容的.

There might also be an issue if you share non-POD (instances of a class, for example) between the DLLs and the executable. I'm not sure whether or not class instances are guaranteed to be binary compatible between debug and release.

这篇关于将发布 dll 与调试主应用程序 exe 混合的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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