jaz@calvin (01/18/90)
I built gcc 1.36, g++ 1.36.2 and libg++ 1.36.2 on a sparcstation 1...
I get an unresolved external error on symbol LBE242 when linking
tPlex in the test subdirectory of 1.36.2 of libg++. I can't find reference
to this symbol anywhere.
Also the following code generates a 250kb binary:
#include <stream.h>
main()
{
cout << "hello, world";
}
The corrosponding gcc program produces a 30kb binary.
Is there that much overhead here ? Do the commercial C++ compilers do
much better at this ?
-jaz@calvin.icd.com
dl@g.g.oswego.edu (Doug Lea) (01/19/90)
First, please send g++ or libg++ questions to the GNU mailing lists (like bug-lib-g++@prep.ai.mit.edu), not to more general newsgroups. (I wouldn't followup here either, except it's a good opportunity to remind people.) > I get an unresolved external error on symbol LBE242 when linking > tPlex in the test subdirectory of 1.36.2 of libg++. I can't find reference > to this symbol anywhere. This unused/unnecessary debugger reference to an optimized-out label is fixed in 1.36.3, but, as it says in the installation instructions, it is a good idea to use the gnu assembler, which can handle such things. > Also the following code generates a 250kb binary: > #include <stream.h> > main() > { > cout << "hello, world"; > } > > The corrosponding gcc program produces a 30kb binary. > Is there that much overhead here ? Do the commercial C++ compilers do > much better at this ? > The difference stems mainly from the *current* inability of g++ to handle/manage/generate shared libraries like those used with Sun C programs. The .o file is only 416 bytes on a SPARC. Most of the other 250K results from the linker pulling in a good part of libg++, plus Sun C libraries. With shared libraries (as are possible now with C), the differences between C and C++ executable sizes should be much smaller. -Doug -- Doug Lea, Computer Science Dept., SUNY Oswego, Oswego, NY, 13126 (315)341-2367 email: dl@oswego.edu or dl%oswego.edu@nisc.nyser.net UUCP :...cornell!devvax!oswego!dl or ...rutgers!sunybcs!oswego!dl