Re: P.S. Why would release static lib be significantly larger then my debug build?



nospam wrote:
Carl Daniel [VC++ MVP] wrote:

[ explanation of large library size snipped ]

I did notice that in another DLL project, the DLL size is fairly small
even though the huge library of the first project is included in the
DLL.
What is best if I really do not care about size? Should I have /GL
and /LTCG declared?

If you care about finished DLL/EXE size, then using /GL and /LTCG is the way
to go. The only downside - it substantially increases link time, but in
exchange, can result in up to 30% smaller code in real-world cases (much
more in artifically constructed cases). The link-time code generation can
do cross-module inlining which simply isn't possible when compiling one
module at a time. Also, if you're using Visual Studio Professional or
above, /GL is the stepping stone to profile-guided optimization, which can
sometimes yield up to another 30% improvement (again, even more in some
scenarios).


Is there some place that tells me where the compiler / linker switches
can be found in the corresponding GUI settings in Visual Studios?

Wouldn't that be nice! I've never seen such a reference, but it might be
out there somewhere. The fall back is to use the "Command line" portion of
the project properties dialog to observe the effect of changing some IDE
setting. In most cases, if you compare the description of the setting in
the IDE with the help text the command-line compiler provides (cl /? at a
command prompt), you'll be able to figure out the mapping.

-cd




.



Relevant Pages

  • Re: K&R 1.5.1 exercise
    ... > the EXE file and run it by hand in a standalone console window. ... > The C beginner using K&R2 is better served by a command line compiler than ... > by any kind of IDE. ... > with a command line environment in mind. ...
    (comp.lang.c)
  • Re: Command line compiler when there are images in the project: any suggestion?
    ... Nicholas Paldino ... >>> I have to use the command line compiler and I use the following command>>> line: ... >>> On the other side, if I try to compile it with the VS IDE everything>>> works ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: Command Line Compiler Config File
    ... specific settings in the dcc32.cfg file in the project folder. ... I just wanted to make sure that the command line compiler is not ... At one point, a.cfg file was also created by the IDE, ...
    (borland.public.delphi.non-technical)
  • Re: Command Line Compiler Config File
    ... I couldn't find anything on the command line compiler ... At one point, a.cfg file was also created by the IDE, ... the command line compiler from using the IDE settings in that file. ... in the IDE and use MSBuild from the command line. ...
    (borland.public.delphi.non-technical)
  • Re: gfortran iso c bindings - capabilities
    ... free to pick any companion processor it chooses. ... invoked with different command line options. ... if %errorlevel% NEQ 0 goto errorexit ... The compiler is supposed to incorporate the information about the ...
    (comp.lang.fortran)