From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Jason M'Sadoques" To: gcc-help@gcc.gnu.org Subject: compiling programs with libstdc++ Date: Wed, 01 Aug 2001 15:39:00 -0000 Message-id: <200108012239.f71MdsP28172@chmls16.mediaone.net> X-SW-Source: 2001-08/msg00010.html I just compiled libstdc++ 2.90.8, to be used with gcc 2.95.2. I followed the directions for compiling just the library, since I already had a working copy of gcc, except that I had to edit a Makefile to comment out the WERROR=-Werror line because it was treating warnings as errors and would not finish compiling. It compiled and installed fine, but however, when I try a test program: //Test out libstdc++. #include #include int main() { cout << hex << showbase; cout << int(12); } I get these errors in trying to link: jlm /home/jlm/code2/temp 252>g++ -I/usr/include/g++-v3 dud.cpp /tmp/ccWA5q6N.o: In function `main': /tmp/ccWA5q6N.o(.text+0x1c): undefined reference to `basic_ostream >::operator<<(ios_base &(*)(ios_base &))' /tmp/ccWA5q6N.o(.text+0x27): undefined reference to `basic_ostream >::operator<<(ios_base &(*)(ios_base &))' /tmp/ccWA5q6N.o: In function `__static_initialization_and_destruction_0': /tmp/ccWA5q6N.o(.text+0x66): undefined reference to `ios_base::Init::Init(void)' /tmp/ccWA5q6N.o(.text+0x7b): undefined reference to `ios_base::Init::~Init(void)' /tmp/ccWA5q6N.o: In function `basic_ostream >::operator<<(int)': /tmp/ccWA5q6N.o(.gnu.linkonce.t.__ls__t13basic_ostream2ZcZt11char_traits1Zci+0x67): undefined reference to `basic_ostream >::operator<<(unsigned long)' /tmp/ccWA5q6N.o(.gnu.linkonce.t.__ls__t13basic_ostream2ZcZt11char_traits1Zci+0x7c): undefined reference to `basic_ostream >::operator<<(long)' collect2: ld returned 1 exit status but I get this error if I specify the library path: jlm /home/jlm/code2/temp 251>g++ -I/usr/include/g++-v3 -L/usr/lib dud.cpp /usr/lib/libstdc++.so: undefined reference to `__ne__H3ZPPQ26locale5facetZPPQ26locale5facetZt6vector2ZPQ26locale5facetZt9allocator1ZPQ26locale5facet_RCt17__normal_iterator2ZX01ZX21RCt17__normal_iterator2ZX11ZX21_b' collect2: ld returned 1 exit status Now this is odd, because it should already know the library path. I'm not sure how this happened, and any help in getting things to compile would be appreciated. I am running Linux 2.2.17 on an i386 machine. Thanks -- MACINTOSH = Machine Always Crashes If Not The Operating System Hangs "Life would be so much easier if we could just look at the source code." - Dave Olson