Huge binaries?
Gerald Gutierrez
gutier@intergate.bc.ca
Fri Nov 19 15:10:00 GMT 1999
>
> HUGE, huh?
Yes, fairly huge. The following transcript:
----------------------------------------------------------
-gcc- [gerald c]$ g++ -v
Reading specs from /z/opt/gcc-2.95.2/lib/gcc-lib/i686-pc-linux-gnu/pgcc-2.95.2/specs
gcc version pgcc-2.95.2 19991024 (release)
-gcc- [gerald c]$ g++ -c huge.cc
-gcc- [gerald c]$ g++ -o huge huge.o
-gcc- [gerald c]$ ls -l huge*
-rwxr-xr-x 1 gerald gerald 339488 Nov 19 15:05 huge
-rw-r--r-- 1 gerald gerald 214 Nov 19 15:03 huge.cc
-rw-r--r-- 1 gerald gerald 25464 Nov 19 15:04 huge.o
-gcc- [gerald c]$
----------------------------------------------------------
is generated by the following source:
----------------------------------------------------------
#include <list>
#include <iostream>
using namespace std;
int
main (int ac, char* av[])
{
list<int> l;
l.push_back(1);
l.push_back(2);
cout << "Size is" << l.size() << '\n';
return 0;
}
----------------------------------------------------------
At least it looks like a small program. Why does it generate a
339K executable and a 25K object file? I also remember trying to
compile things like GTK-- and having each object file about 500K in
size.
Is this "normal"?
More information about the Libstdc++
mailing list