Huge executable [message #156678] |
Sun, 23 October 2005 22:10  |
Eclipse User |
|
|
|
Originally posted by: pretzel_n_g.hotmail.com
Hi,
I'm using CDT 3.0.0 & Cygwin/gcc/g++ on WinXP.
I believe I'm trying to dynamically link to shared libraries... ie I've
checked Project Properties->C/C++ Build->GCC C++ Linker->Shared Library
Settings->Shared checkbox. The other fields on this page (eg. shared
object, import library name) are empty however.
When I look at the Modules panel whilst debugging I see that cygwin1.dll
is listed as well as a few others.
However, when I build my executable is 554KB. When I build a Release
version, it is around 440KB. I'm sure that it is to do with static
linking of libraries, because when I compare it with a significantly
more complex application build using MSVC++ dynamically linked to
libraries, the application is only 50KB.
Could anyone please give me some help on how to configure Eclipse CDT to
work with Cygwin/gcc to dynamically link to libraries properly please?
Thanks very much for your help.
PretzelX.
|
|
|
|
Re: Huge executable [message #157822 is a reply to message #156678] |
Fri, 11 November 2005 16:48  |
Eclipse User |
|
|
|
Originally posted by: radoslawg.xxxx.xx
PretzelX napisał(a):
> Hi,
>
> I'm using CDT 3.0.0 & Cygwin/gcc/g++ on WinXP.
>
> I believe I'm trying to dynamically link to shared libraries... ie I've
> checked Project Properties->C/C++ Build->GCC C++ Linker->Shared Library
> Settings->Shared checkbox. The other fields on this page (eg. shared
> object, import library name) are empty however.
>
> When I look at the Modules panel whilst debugging I see that cygwin1.dll
> is listed as well as a few others.
>
> However, when I build my executable is 554KB. When I build a Release
> version, it is around 440KB. I'm sure that it is to do with static
> linking of libraries, because when I compare it with a significantly
> more complex application build using MSVC++ dynamically linked to
> libraries, the application is only 50KB.
Not necessary. You can't really compare codes generated from different
compilers.
Anyway. First thing to do would be to strip the executable file (strip
<name_of_file> ). It should slim your exec a lot of kilobytes.
Also I would recommend browsing through gcc (g++) manual to find out
what other options you have when compiling/linkg C/C++ applications as
well as some general info about how gcc works.
Cheers,
Radek.
|
|
|
Powered by
FUDForum. Page generated in 0.08035 seconds