Method to reduce the size of exe files generated by VC6 compilation

  • 2020-04-02 02:58:00
  • OfStack

1. The most effective way to reduce the size of exe file generated by VC6 compilation is:

Steps:

1. Use the release version

2. Add: #pragma comment(linker, "/OPT:nowin98 ")

3. The project -- -- > Setting - > C/c + + - > The link - > Ignore all default libraries

4. Project -- -- > Setting - > C/c + + - > The link - > Object /library modules: add several lib files (e.g. Void main(){} or WinMain() program add msvcrt.lib). Different programs need different lib files.
And be sure to add it to the project-- > Setting - > C/c + + - > The link - > The object/library modules,
#parama comment(lib, "*.lib) is not acceptable.
Looking up MSDN, it is easy to find the required lib.

5. Using UPX compression: http://upx.sourceforge.net


Related articles: