![]() |
VS10 creates bloated static libs |
Post Reply ![]() |
Author | |
rconn ![]() Groupie ![]() Joined: 16 May 2007 Location: United States Status: Offline Points: 79 |
![]() ![]() ![]() ![]() ![]() Posted: 09 May 2010 at 4:54pm |
Using 13.3.1 and VS2010.
I converted from 13.2.1 to 13.3.1 and switched to VS2010 at the same time. After rebuilding everything I found that my release .exe's had increased 50% in size.
I'm statically linking 13.3.1. Looking at the libs I see that the Codejock *SU.LIB file has increased 40-50% in size using VS2010 versus the same lib using VS2008 (and is nearly the size of the debug lib). The debug lib (*SUD.LIB) is roughly the same size as in VS2008.
I presume something is misconfigured in the VS2010 release properties.
|
|
![]() |
|
eddiepaz ![]() Groupie ![]() ![]() Joined: 28 October 2004 Location: United States Status: Offline Points: 12 |
![]() ![]() ![]() ![]() ![]() |
I assume this has to do with VS 2010 creating bloated executables when statically compiling. A simple dialog application is now 1.6MB, and MS says it's because of the new features. <g> |
|
![]() |
|
rconn ![]() Groupie ![]() Joined: 16 May 2007 Location: United States Status: Offline Points: 79 |
![]() ![]() ![]() ![]() ![]() |
That might be part of it, though the Codejock-supplied projects were also including debug info in the VS2010 release builds. When I took that option out, the Codejock libs dropped 30mb+ in size. That reduced my release build size significantly, though it was still bigger than VS2008 (presumably because of VS2010 & static linking).
|
|
![]() |
|
Smucker ![]() Senior Member ![]() ![]() Joined: 02 February 2008 Status: Offline Points: 156 |
![]() ![]() ![]() ![]() ![]() |
I always include debug info in .LIBs, so that it gets propagated to the final .PDB and .MAP generated with the .EXE, making dumps readable. (I don't distribute the PDB or MAP.)
For a smaller EXE, you may want to turn on function-level linking (/Gy in the compiler), so that unreferenced code doesn't get in the EXE. I don't know of anything this breaks, unless you're doing some weird stuff with pointers to functions or methods. I do this for all projects. That note from Microsoft seems rather odd; I wonder if the MFC libraries are being compiled /Gy, or if they're just doing something else wrong. |
|
Product: Xtreme Toolkit Pro version 13.2 (Unicode, static build)
Platform: Windows 200x/XP/Vista/Win7 (32/64 bit) Language: Visual C++ 9.0 (Studio 2008) |
|
![]() |
|
rconn ![]() Groupie ![]() Joined: 16 May 2007 Location: United States Status: Offline Points: 79 |
![]() ![]() ![]() ![]() ![]() |
I always use /Gy. It doesn't help in this case.
|
|
![]() |
|
Smucker ![]() Senior Member ![]() ![]() Joined: 02 February 2008 Status: Offline Points: 156 |
![]() ![]() ![]() ![]() ![]() |
I wonder if the MFC lib is compiled with /Gy (or if there's some reason it can't be).
|
|
Product: Xtreme Toolkit Pro version 13.2 (Unicode, static build)
Platform: Windows 200x/XP/Vista/Win7 (32/64 bit) Language: Visual C++ 9.0 (Studio 2008) |
|
![]() |
|
znakeeye ![]() Senior Member ![]() ![]() Joined: 26 July 2006 Status: Offline Points: 1672 |
![]() ![]() ![]() ![]() ![]() |
Are you using VS2008 or VS2008 SP1? My guess is that you get the same bloat in VS2008 SP1.
|
|
PokerMemento - http://www.pokermemento.com/
|
|
![]() |
|
rconn ![]() Groupie ![]() Joined: 16 May 2007 Location: United States Status: Offline Points: 79 |
![]() ![]() ![]() ![]() ![]() |
Nope, no problem with VS2008 SP1.
|
|
![]() |
|
znakeeye ![]() Senior Member ![]() ![]() Joined: 26 July 2006 Status: Offline Points: 1672 |
![]() ![]() ![]() ![]() ![]() |
If you're linking statically with MFC, then you will get bloat in VS 2008 SP1 and VS 2010. This is due to the ribbon graphics included in the new versions of MFC.
|
|
PokerMemento - http://www.pokermemento.com/
|
|
![]() |
|
znakeeye ![]() Senior Member ![]() ![]() Joined: 26 July 2006 Status: Offline Points: 1672 |
![]() ![]() ![]() ![]() ![]() |
Also, make sure you have NO references to afxcontrolbars.h or CWinAppEx.
|
|
PokerMemento - http://www.pokermemento.com/
|
|
![]() |
Post Reply ![]() |
|
Tweet
|
Forum Jump | Forum Permissions ![]() You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum |