This is the mail archive of the libstdc++@sourceware.cygnus.com mailing list for the libstdc++ project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

link problem


Hi all,

I build a new gcc, g++ along with latest snapshot of libstdc++-2.90.8.
Build
and installation went well. But when I compile the simple program you see
below I get some undefined references during link.

--------------------------------
The Program:

#include <iostream>
using namespace std;
main()
{
cout << "Hello" << endl;
exit(0);
}
---------------------------------

Command line and errors:
c++ -v -fhonor-std -o proc proc.cpp 

{Reading specs from /usr/local/lib/gcc-lib/i686-pc-linux-gnu/2.95.2/specs
gcc version 2.95.2 19991024 (release)
/usr/local/lib/gcc-lib/i686-pc-linux-gnu/2.95.2/cpp -lang-c++ -v 
-D__GNUC__=2 -D__GNUG__=2 -D__GNUC_MINOR__=95 -D__cplusplus 
-D__ELF__ -Dunix -D__i386__ -Dlinux -D__ELF__ -D__unix__ 
-D__i386__ -D__linux__ -D__unix -D__linux -Asystem(posix) 
-D__EXCEPTIONS -Acpu(i386) -Amachine(i386) -Di386 -D__i386 
-D__i386__ -Di686 -Dpentiumpro -D__i686 -D__i686__ -D__pentiumpro
-D__pentiumpro__ proc.cpp /tmp/ccGSPz32.ii GNU CPP version 2.95.2 19991024
(release) (i386 Linux/ELF) #include "..." search starts here: #include
<...>
search starts here:  /usr/local/qt/include 
/usr/local/lib/gcc-lib/i686-pc-linux-gnu/2.95.2/../../../../include/g++-v3

/usr/local/include

/usr/local/lib/gcc-lib/i686-pc-linux-gnu/2.95.2/../../../../i686-pc-linux-gnu/include 
/usr/local/lib/gcc-lib/i686-pc-linux-gnu/2.95.2/include  /usr/include End
of search list.
The following default directories have been omitted from the search path:
End of omitted list.
/usr/local/lib/gcc-lib/i686-pc-linux-gnu/2.95.2/cc1plus /tmp/ccGSPz32.ii
-quiet 
-dumpbase proc.cc -version -fhonor-std -o /tmp/ccpRsp60.s
GNU C++ version 2.95.2 19991024 (release) (i686-pc-linux-gnu) compiled by
GNU C version 2.95.2 19991024 (release).
as -V -Qy -o /tmp/ccpTFFAv.o /tmp/ccpRsp60.s
GNU assembler version 2.9.1 (i386-redhat-linux), using BFD version
2.9.1.0.24
/usr/local/lib/gcc-lib/i686-pc-linux-gnu/2.95.2/collect2 -m elf_i386
-dynamic-linker 
/lib/ld-linux.so.2 -o proc /usr/lib/crt1.o /usr/lib/crti.o
/usr/local/lib/gcc-lib/i686-pc-linux-gnu/2.95.2/crtbegin.o
-L/usr/local/lib/gcc-lib/i686-pc-linux-gnu/2.95.2 -L/usr/local/lib
/tmp/ccpTFFAv.o -lstdc++ -lm -lgcc -lc -lgcc
/usr/local/lib/gcc-lib/i686-pc-linux-gnu/2.95.2/crtend.o /usr/lib/crtn.o
/tmp/ccpTFFAv.o: In function `std::ios_base::failure type_info function':
/tmp/ccpTFFAv.o(.gnu.linkonce.t.__tfQ33std8ios_base7failure+0x10):
undefined
reference to `std::exception type_info function'
/tmp/ccpTFFAv.o(.gnu.linkonce.t.__tfQ33std8ios_base7failure+0x1a):
undefined
reference to `std::exception type_info node' /usr/local/lib/libstdc++.so:
undefined reference to `std::bad_alloc::~bad_alloc(void)'
/usr/local/lib/libstdc++.so: undefined reference to `std::bad_cast
type_info
node' /usr/local/lib/libstdc++.so: undefined reference to `std::bad_cast
virtual table' /usr/local/lib/libstdc++.so: undefined reference to
`std::bad_alloc virtual table' /usr/local/lib/libstdc++.so: undefined
reference
to `std::bad_cast type_info function' /usr/local/lib/libstdc++.so:
undefined
reference to `std::terminate(void)' /usr/local/lib/libstdc++.so: undefined
reference to `std::uncaught_exception(void)' /usr/local/lib/libstdc++.so:
undefined reference to `std::exception virtual table' collect2: ld
returned 1
exit status
--------------------------------------------------------
It seems the problems is locatated in the libgcc.a because:

> nm --demangle libgcc.a | grep "std::exception"
produces empty output

but 

> nm --demangle libgcc.a | grep exception0000062c t find_exception_handler
00000594 t old_find_exception_handler
exception.o:
00000764 T bad_exception::~bad_exception(void)
000006fc T exception::~exception(void)
00000734 T bad_exception::bad_exception(void)
000006d4 T exception::exception(void)
000000b4 T __cp_exception_info
00000270 T __cp_pop_exception
000001fc T __cp_push_exception
00000004 W bad_exception type_info function
00000004 W exception type_info function
0000000c C bad_exception type_info node
00000008 C exception type_info node
00000320 T __uncatch_exception
00000000 W bad_exception virtual table
00000000 W exception virtual table
00000668 T uncaught_exception(void)
0000069c T exception::what(void) const
U exception type_info function
U exception type_info node
U exception virtual table
U __cp_pop_exception
U __cp_pop_exception
U __cp_pop_exception
U __cp_push_exception
U exception virtual table
U __cp_pop_exception
U __cp_pop_exception
U __cp_pop_exception
U __cp_pop_exception
U __cp_pop_exception
U exception type_info function
U exception type_info node
U exception virtual table
U exception::what(void) const
--------------------------------

What went wrong.

I would appreciate some hints

Thanks 
Juergen



-- 
Sent through GMX FreeMail - https://www.gmx.net


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]