What's bringing these symbols in???
Benjamin Scherrey
scherrey@innoverse.com
Sun Sep 16 19:34:00 GMT 2001
When doing:
gcc -Wl,-Bstatic -o wipedrive Display.o Eraser.o FileDevice.o Progress.o
Selection.o /usr/lib/libncurses.a /usr/local/lib/libcdk.a
I get these linker errors:
Eraser.o: In function
'__malloc_alloc_template<0>::gnu.linkonce.t._S_oom_malloc(unsigned int)':
Eraser.o(.__malloc_alloc_template<0>::gnu.linkonce.t._S_oom_malloc(unsigned
int)+0x22): undefined reference to 'cerr'
Eraser.o(.__malloc_alloc_template<0>::gnu.linkonce.t._S_oom_malloc(unsigned
int)+0x22): undefined reference to 'ostream::operator<<(char const *)'
Eraser.o(.__malloc_alloc_template<0>::gnu.linkonce.t._S_oom_malloc(unsigned
int)+0x22): undefined reference to 'endl(ostream &)'
I'm writing a utility that will exist in very limited disk space (a boot
floppy) and cannot afford to link in libstdc++. No where do I use iostreams
in my application. I do use new & delete as well as a vector.
What is causing the reference to these symbols? How can I kill these linker
requirements? Is there any way I can force the linkage with the symbols
missing? My program will never get to these symbols unless it crashes so
frankly I don't care if they're faked. This is driving me nuts! My program is
700K when i include libstdc++ which is completely insane. It needs to be
under 400K.
I'm running under gcc-2.95.2.1 with Intel Linux 2.2.19.
thanx & later,
Ben Scherrey
More information about the Gcc
mailing list