在 Debug 中构建项目与在 Release 中构建项目有何不同?

发布于 2024-08-28 17:33:55 字数 102 浏览 4 评论 0原文

在 Visual Studio 或任何其他 IDE 中,通常有两种构建配置:调试和发布? 有什么不同?为什么有时在调试模式下构建时会出现编译错误,而在发布模式下则不会出现编译错误,反之亦然?

In visual studio or any other IDE, usually there are two build configurations, Debug and Release?
How does the differ? Why sometimes you have compile errors when building in Debug mode, but not when in Release mode, and vice versa?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

冷情 2024-09-04 17:33:55

调试使用符号进行编译,并允许您在代码运行时“查看”代码。它还对变量进行一些初始化以帮助错误跟踪过程。

Release 一般都会进行优化,并且不会生成调试数据。

通常,当您遇到在两者之间切换的编译问题时,它与文件夹的硬编码路径有关。

MSDN 配置

Debug compiles with symbols and allows you to "see" your code when it runs. It also does some initialization of variables to help in the bug tracking process.

Release is generally optimized, and does not generate debug data.

Generally when you get compile issues toggling between the two, it relates to hard coded paths to folders.

MSDN on configurations

独自←快乐 2024-09-04 17:33:55

调试版本是使用一些嵌入信息(符号)创建的,这些信息允许调试器调试应用程序并公开应用程序的运行时行为。不利的一面是,调试构建的执行速度较慢且效率低下,并且内存占用较大。

来源:http://www.programmersheaven.com/2/FAQ-VISUALSTUDIO-调试-发布

The debug build is created with some embedded information (symbols) which allows the debugger to debug the application and exposes the runtime behavior of the application. On the down side, the debug build is a bit slower and inefficient in execution and has a bigger memory footprint.

Source:http://www.programmersheaven.com/2/FAQ-VISUALSTUDIO-Debug-Release

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文