减少视觉工作室的exe大小 [英] reduce exe size in visual studio

查看:69
本文介绍了减少视觉工作室的exe大小的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我似乎无法减少使用VS 2010构建的exe大小,我遵循了许多指南,每次我的文件是51kb而且它所做的只是MessageBoxA



我从头到尾都遵循了这个指南



http://linkyzer0.com/papers/Decrease_Win...leSize.pdf



我做错了什么?

解决方案

51K不是那么大;并且它所做的就是MessageBoxA并不完全正确 - 即使是最小的Windows应用程序也会在幕后发生很多事情。



为什么会这些天51K的足迹是个问题? :笑:





只是一个想法:如果你真的认为它只是一行那么你可以减少金额与之链接的Windows代码:

1)确保您使用的是发行版

2)编辑您的项目属性:

2.1 )配置属性...链接器...系统

2.2)子系统:更改为未设置。

2.3)使用确定按钮保存更改。



重建(如果编译干净)检查文件大小。

[/ edit]


< blockquote>一个替代想法:迁移到.NET平台,您可以在其中使用C ++ / CLI并将.NET托管代码与本机C ++代码自由组合。由于.NET程序集静态链接,所以它最小化了模块的大小。尺寸差异如果真的非常大。



-SA


i cant seem to reduce my exe size that was built with VS 2010, ive followed many guides and everytime my file is 51kb and all it does is MessageBoxA

I have followed this guide from start to finish

http://linkyzer0.com/papers/Decrease_Win...leSize.pdf

what am i doing wrong ?

解决方案

51K isn't that big; and "all it does is MessageBoxA" isn't quite true - there is a lot going on "behind the scenes" in even a minimal Windows App.

Why would a 51K footprint be a problem these days? :laugh:

[edit]
Just a thought: if you really think it's "only one line" then you can reduce the amount of windows code that it's linked with:
1) Make sure you are on the Release version
2) Edit your project properties:
2.1) Configuration Properties...Linker...System
2.2) SubSystem: change to "Not Set".
2.3) save the changes with the "OK" button.

Rebuild (and if it compiles clean) check the file size.
[/edit]


One alternative idea: migrate to .NET platform where you can use C++/CLI and freely combine .NET managed code with native C++ code. As .NET assemblies link statically next to nothing, it minimizes the size of their modules. The difference in size if really impressively big.

—SA


这篇关于减少视觉工作室的exe大小的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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