Visual Studio 2013 creates more EXE - no MFC

I am a little late with this question, but better late than never. I am using Visual Studio 6.0 as it came out but recently switched to VS 2013 on a new PC.

I got my projects to build prior to 2013, but the resulting executables are consistently superior to VS6.0. I saw a similar thread here on what happens when moving from VS2008 to VS2010, and the comments and suggestions there seem to attribute the change to changes in the MFC libraries that are statically linked. But my projects are straight C code, No C ++, let alone MFC. The "Use MFC" option in my project is set to "Use Windows Standard Libraries" (presumably set by the import tool that generated the 2013 compatible project). The only library other than it is wsock32.lib.

The extra size isn't a killer, but it is significant relative to the size of the entire application. My largest .exe is 980KB to 1.3MB - about 35% larger than the app that was selling small (i.e. Install this tiny app and you have access to all our goodies) ... This is without debug information - increasing the debug version even more - but I don't care at all.

Any ideas how to carve out a new dash - or even know what it is?

+3


source to share


2 answers


Typically, you create a MAP file on both systems and identify the sections that generate the most contributions.



Anton's answer reminds me: first check if they are related the same way (both static and dynamic, otherwise they are apples and oranges)

+1


source


This is a good guide on how to shrink your binaries.

The main ideas are as follows:



  • Don't forget about release mode
  • Announce #define WIN32_LEAN_AND_MEAN

  • Dynamic link to C ++ runtime
  • Compile executable file without debug information
  • Compile with / O 1, "optimize for size" flag
  • Remove the iostream and fstream headers, use low level instead
+1


source







All Articles