GNU C vs BCC - huge output file

A

azemerov

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.
 
V

Victor Bazarov

azemerov said:
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.
[..]

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
 
N

Neil Cerutti

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.

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

GDB, I know, I know, off topic 2
Dev C++ compile problem 2
linker error w/ templates 5
template error 10
Does not name a type error 1
Compiler errors 11
a complie error ? 1
problem compiling WinNTL on Windows system. 1

Members online

Forum statistics

Threads
473,744
Messages
2,569,483
Members
44,901
Latest member
Noble71S45

Latest Threads

Top