This is the mail archive of the
libstdc++@gcc.gnu.org
mailing list for the libstdc++ project.
Independent libstdc++
- From: Garrett Kajmowicz <gkajmowi at tbaytel dot net>
- To: libstdc++ at gcc dot gnu dot org
- Date: Sun, 4 Jul 2004 16:54:18 -0400
- Subject: Independent libstdc++
- Reply-to: gkajmowi at tbaytel dot net
As a learning project, I am attempting to implement the C++ standard library.
I know that this is a huge undertaking, and have spent about 3 weeks working
on it so far. I am to the point now where I should be able to compile a
"hello world" application using iostreams.
Of course, things aren't working as I had planned. Since I am using gcc
3.3.3, I have kept some of the original header files, namely typeinfo and
exception, as well as a number of the c* files.
I am compiling with the following command line:
g++ -o io io.o -O2 -g -Wall -Wpointer-arith -Wstrict-prototypes -W -pedantic
-march=athlon-xp -nodefaultlibs -nostdinc++ -fno-builtin -L../src
-I../include/ -lgcc -lc -lsupc++ -lgcc_s -luClibc++
The library I have written is uClibc++ , in hopes that it might eventually be
used with the uclibc project. The library copmiles fine.
If I compile a return 0 application, I get the following compile error:
../src/libuClibc++.so: undefined reference to `std::exception::~exception
[not-in-charge]()'
../src/libuClibc++.so: undefined reference to `__cxa_call_unexpected'
../src/libuClibc++.so: undefined reference to `std::exception::what() const'
../src/libuClibc++.so: undefined reference to `vtable for
__cxxabiv1::__si_class_type_info'
../src/libuClibc++.so: undefined reference to `__gxx_personality_v0'
../src/libuClibc++.so: undefined reference to `typeinfo for std::exception'
../src/libuClibc++.so: undefined reference to `vtable for
__cxxabiv1::__class_type_info'
../src/libuClibc++.so: undefined reference to `__cxa_throw'
../src/libuClibc++.so: undefined reference to `vtable for
__cxxabiv1::__vmi_class_type_info'
../src/libuClibc++.so: undefined reference to `__cxa_allocate_exception'
collect2: ld returned 1 exit status
However, if my main function looks like:
int main(){
std::exception a;
return 0;
}
It compiles fine, but I get a segfault on execution.
Could somebody please point me in the right direction?
Thank you for your help.
- Garrett Kajmowicz