c++ - Visual C++ 表达 2008 : Why does it places megs of null bytes at the end of the release executable?

标签 c++ visual-c++ size release-mode

最近我发现我的发布可执行文件(使用 msvc++ express 2008 制作)变得非常大。当我使用十六进制查看器检查可执行文件时,我看到只有前 300k 字节包含有用数据,其余字节仅为零 - 6 兆零字节。

调试构建的 exe 大小为 1MB,但发布版为 6.5MB。

为什么 MSVC++ express 会做那些无用的事情?我该如何解决?

最佳答案

您是否在程序中的文件范围内定义了大型数组?这可能是原因之一。您可以使用 dumpbin 程序查看 exe 文件中的每个部分占用多少空间,这应该可以让您了解“为什么”。

关于c++ - Visual C++ 表达 2008 : Why does it places megs of null bytes at the end of the release executable?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/477885/

相关文章:

c++ - 只要应用程序运行就一直打开错误日志是否可以接受?

c++ - 不用浏览器登录亚马逊

wpf - WPF 星号是做什么的(宽度 ="100*")

python - 在 Python 中使用大小

c++ - 缩小转换差异

c++ - 用于稀疏数据查找的高效数据结构

git - Visual Studio 2015 和 Git 错误 : open ("somefile.VC.opendb"): Permission denied fatal: Unable to process path myfile. VC.opendb

windows - 在编写 Windows 应用程序时需要一些指示/提示

c - 在C中隐藏应用程序窗口

c++使用const变量定义数组大小