[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Smaller executable... how?
From: |
Guy Harrison |
Subject: |
Re: Smaller executable... how? |
Date: |
Thu, 16 Sep 2004 22:10:35 GMT |
User-agent: |
KNode/0.7.7 |
JKop wrote:
>
> This question has probably been asked a thousand times,
> but...
>
> I've got a Win32 console application, compiling it with:
>
> g++ nach.cpp -ansi -pedantic -o nach.exe
>
> I'm ending up with a 400KB executable.
>
> How can I scale this down without sacrificing runtime
> performance?
"man gcc" optimise for size (-Os). Likely to be more effective is "man
strip". Do bear in mind that "native" windows compilers typically default
to pulling in DLL's so whilst your exe may only take a few Kb in disk it's
runtime footprint is another matter.
Also, use more source files & put less code in each of them.