且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

在调试或释放模式下使用DLL?

更新时间:2023-09-29 16:58:22

为了使DLL内部在调试模式下可见,在调试模式。否则,没有调试信息可用(例如观察变量,步进等)。另一方面,在调试模式下编译的DLL不应该用于发布,因为它较慢并且包含不必要的代码。我不知道调试功能的存在是否构成安全风险,但在生产环境中的DLL中有额外的钩子并不安全。



希望帮助!


I downloaded a precompiled SQLite DLL from http://www.sqlite.org at this link sqlite-dll-win32-x86-3080600.zip.

Can I use the same DLL both in Debug and Release mode? What would be the difference and how is it possible? I'm using Visual C++ 2012 Compiler.

For the DLL internals to be visible in debug mode, it has to be compiled in debug mode. Otherwise, no debug info will be available (e.g. watch variables, step into, etc.). On the other hand, a DLL compiled in debug mode shouldn't be used for release since it is slower and contains unnecessary code. I am not sure if the existence of the debug functions constitute a security risk, but having additional hooks in your DLL in a production environment doesn't sound safe.

Hope that helps!