Currently i am compiling DLMS library( http://www.gurux.fi/index.php?q=DLMSCOSEMFAQ ) using Visual Studio 2010 (Using C++).
I am successfully compiled the library in debug and release mode. But When i check the size of both library then release one library( .lib ) have more then double size( 76 MB ) then debug one( 31 MB ).
I think release one have smaller size the debug one, is it right?
Is any setting needed in VS2010?
Find build release log here http://pastie.org/9687316
For debug log here http://pastie.org/9687340
Changes the Setting - Configuration Properties > General > Whole Program Optimization from "Use Link Time Code Generation" to "No Whole Program Optimization"
After this change the library size came down from 76MB to 21MB on my machine.
Check out the attached image. Hope this helps you out.
You should compare your build settings, esp. optimization and library linking (static / dynamic). If you are unsure, copy your command line for both linker and compiler and we can check it for you here.
The command line can be found in the build log, or in project Properties
/ C/C++
/ Command Line
and Properties
/ Linker
/ Command Line
.
For compiler the most important settings to look for are /O
, /M
.
For linker I would look esp. for /OPT
.
Your compiler switches are:
/c /Zi /nologo /W3 /WX- /O2 /Oi /Oy- /GL /D WIN32 /D NDEBUG /D _LIB /D _UNICODE /D UNICODE /Gm- /EHsc /MD /GS /Gy /fp:precise /Zc:wchar_t /Zc:forScope /Fo"Release\\\\" /Fd"Release\\vc100.pdb" /Gd /TP /analyze- /errorReport:prompt GuruxDLMS\\GXDateTime.cpp
What is causing your library to be big is /GL
. For explanation see Release mode static library much larger than debug mode version .
I remember checking this after a co-worker complain. Try to play with the compiler switches until the size are identical, then check the documentation of those switches
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.