Rick Strahl's Weblog  

Wind, waves, code and everything in between...
.NET • C# • Markdown • WPF • All Things Web
Contact   •   Articles   •   Products   •   Support   •   Advertise
Sponsored by:
Markdown Monster - The Markdown Editor for Windows

C++ code from VS 2003 -> VS 2005 bloats size

On this page:

Why is it that whenever a new version of Visual Studio comes out and you take a C++ project and migrate it and you simply recompile it the size of the project nearly doubles?


I’ve been thinking about moving a handful of small Win32 DLL utlility libraries to VS2005 to get better editing support and also to slowly fade out usage of VS 2003 (there’s not much left).

But with C++ code every upgrade of VS seems to incur a MAJOR library size hit in every migration especially in small libraries. I seem to remember the same thing happening in moving to VS 2003 from 2002 and Visual Studio 6 before that. It turns out that in most cases there are compiler settings and switches that can get the size down somewhat (though I’ve never been able to reduce the size of these DLLs to the same size as the previous VS version EVER).


So I have a DLL library that was 46k that is now 76k. Another library was 76k that is now 138k. Any of you C++ folks have any quick fix hints that you can think of? I looked over the various compiler options and optimizations and frankly I can’t find anything that makes any difference in the compiled image size.




I'll qualify this right out that my C++ knowledge is limited especially when dealing with compiler settings, which is why this is so damn frustrating. <g>

Posted in C++  

The Voices of Reason


Steve from Pleasant Hill
October 01, 2006

# re: C++ code from VS 2003 -> VS 2005 bloats size

For Win32 apps I would try and avoid anything but a Borland compiler. Even though they are in somewhat of an unheaval right now, I believe their Win32 stuff to be excellent. They have some new downloads worth looking into.


Rick Strahl
October 01, 2006

# re: C++ code from VS 2003 -> VS 2005 bloats size

Steve, I used Borland C++ for some time, but at the time Borland had the same kind of upgrade issues <g>... Every new version produced larger and larger code...

I'm pretty sure that I can probably get these libraries back down in size, but figuring out which of the combinations is the problem. The compiler options have changed slightly in name in many places and there's no way to easily compare between the old and new projects.

October 02, 2006

# re: C++ code from VS 2003 -> VS 2005 bloats size

For any C++ apps that I need to write I use Bloodshed Dev++, it's an opensource C++ editor and compiler and best of all... it doesn't _SEEM_ to bloat your app files. A DLL written in Bloodshed generated to just under 20KB while the exact project in VS 2005 was almost 70KB in size.

Andreas Kraus
October 05, 2006

# re: C++ code from VS 2003 -> VS 2005 bloats size

Thanks for the tipp William, gonna try Bloodshed out. I'm experiencing the same problems as Rick does.

West Wind  © Rick Strahl, West Wind Technologies, 2005 - 2024