Connecting Tech Pros Worldwide Help | Site Map

GNU C vs BCC - huge output file

  #1  
Old December 1st, 2005, 04:55 PM
azemerov
Guest
 
Posts: n/a
Hi,

I build my C++ project (windows DLL) with GNU C and Borland C++.
Everything is fine except huge difference in resulting DLL file size.
GNU C procuces almost 10 times larger file than Borland C (429568 vs
46080)!
I don't belive GNU C is so unoptimized, probably my problem is in
options I use for compiler/linker/dll wrapper.

1) GNU (Dev-Cpp has been used)
g++.exe -c newgen.cpp -o ./obj/newgen.o
-I"C:/Dev-Cpp/lib/gcc/mingw32/3.4.2/include"
-I"C:/Dev-Cpp/include/c++/3.4.2/backward"
-I"C:/Dev-Cpp/include/c++/3.4.2/mingw32"
-I"C:/Dev-Cpp/include/c++/3.4.2" -I"C:/Dev-Cpp/include"
-DBUILDING_DLL=1 -fno-access-control -O3

g++.exe -c ustring.cpp -o ./obj/ustring.o
-I"C:/Dev-Cpp/lib/gcc/mingw32/3.4.2/include"
-I"C:/Dev-Cpp/include/c++/3.4.2/backward"
-I"C:/Dev-Cpp/include/c++/3.4.2/mingw32"
-I"C:/Dev-Cpp/include/c++/3.4.2" -I"C:/Dev-Cpp/include"
-DBUILDING_DLL=1 -fno-access-control -O3

g++.exe -c varstream.cpp -o ./obj/varstream.o
-I"C:/Dev-Cpp/lib/gcc/mingw32/3.4.2/include"
-I"C:/Dev-Cpp/include/c++/3.4.2/backward"
-I"C:/Dev-Cpp/include/c++/3.4.2/mingw32"
-I"C:/Dev-Cpp/include/c++/3.4.2" -I"C:/Dev-Cpp/include"
-DBUILDING_DLL=1 -fno-access-control -O3

g++.exe -c bucketlist.cpp -o ./obj/bucketlist.o
-I"C:/Dev-Cpp/lib/gcc/mingw32/3.4.2/include"
-I"C:/Dev-Cpp/include/c++/3.4.2/backward"
-I"C:/Dev-Cpp/include/c++/3.4.2/mingw32"
-I"C:/Dev-Cpp/include/c++/3.4.2" -I"C:/Dev-Cpp/include"
-DBUILDING_DLL=1 -fno-access-control -O3

g++.exe -c generator1_dll.cpp -o ./obj/generator1_dll.o
-I"C:/Dev-Cpp/lib/gcc/mingw32/3.4.2/include"
-I"C:/Dev-Cpp/include/c++/3.4.2/backward"
-I"C:/Dev-Cpp/include/c++/3.4.2/mingw32"
-I"C:/Dev-Cpp/include/c++/3.4.2" -I"C:/Dev-Cpp/include"
-DBUILDING_DLL=1 -fno-access-control -O3

windres.exe -i Generator1_private.rc --input-format=rc -o
../obj/Generator1_private.res -O coff

dllwrap.exe --output-def ../../pas/exe/maptool/libgenerator_gnu.def
--driver-name c++ --implib ../../pas/exe/maptool/libgenerator_gnu.a
../obj/newgen.o ./obj/ustring.o ./obj/varstream.o ./obj/bucketlist.o
../obj/generator1_dll.o ./obj/Generator1_private.res -L"C:/Dev-Cpp/lib"
--no-export-all-symbols --add-stdcall-alias -s -o
.../../pas/exe/maptool/generator_gnu.dll

result file size 429568 bytes


2) BCC55
bcc32 -ec:\wrk\pas\exe\maptool\generator_bcc.dll -DBUILDING_DLL=1 -c -P
-WD -O2 -Vx -Ve -X- -a8 -b- -k- -vi -tWD -tWM- -q -n.\obj
generator1_dll.cpp bucketlist.cpp newgen.cpp ustring.cpp varstream.cpp
ilink32 -q -D"" -aa -Tpd -x -Gn -Gi -M C0D32.OBJ CW32.LIB IMPORT32.LIB
, c:\wrk\pas\exe\maptool\generator_bcc.dll

result file size 46080 bytes

Thanks,
Alexander Zemerov.

  #2  
Old December 1st, 2005, 05:05 PM
Neil Cerutti
Guest
 
Posts: n/a

re: GNU C vs BCC - huge output file


On 2005-12-01, azemerov <azemerov@inbox.ru> wrote:[color=blue]
> Hi,
>
> I build my C++ project (windows DLL) with GNU C and Borland
> C++. Everything is fine except huge difference in resulting DLL
> file size. GNU C procuces almost 10 times larger file than
> Borland C (429568 vs 46080)! I don't belive GNU C is so
> unoptimized, probably my problem is in options I use for
> compiler/linker/dll wrapper.[/color]

Consult manual about g++ command line options. Or try a newsgroup
concerned with the GNU compiler suite. Object file size is
implementation defined, and thus not on topic for this newsgroup.

--
Neil Cerutti
  #3  
Old December 1st, 2005, 05:05 PM
Victor Bazarov
Guest
 
Posts: n/a

re: GNU C vs BCC - huge output file


azemerov wrote:[color=blue]
> I build my C++ project (windows DLL) with GNU C and Borland C++.
> Everything is fine except huge difference in resulting DLL file size.
> GNU C procuces almost 10 times larger file than Borland C (429568 vs
> 46080)!
> I don't belive GNU C is so unoptimized, probably my problem is in
> options I use for compiler/linker/dll wrapper.
> [..][/color]

This is off-topic here. Sizes of resulting programs have nothing to do
with the language itself. Please ask in a GNU newsgroup (gnu.g++.help).

V
Closed Thread