public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
* compiling programs with libstdc++
@ 2001-08-01 15:39 Jason M'Sadoques
  2001-08-01 19:25 ` aoliva
  0 siblings, 1 reply; 4+ messages in thread
From: Jason M'Sadoques @ 2001-08-01 15:39 UTC (permalink / raw)
  To: gcc-help

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 <iostream>
#include <ios>

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<char, char_traits<char> >::operator<<(ios_base &(*)(ios_base &))'
/tmp/ccWA5q6N.o(.text+0x27): undefined reference to `basic_ostream<char, char_traits<char> >::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<char, char_traits<char> >::operator<<(int)':
/tmp/ccWA5q6N.o(.gnu.linkonce.t.__ls__t13basic_ostream2ZcZt11char_traits1Zci+0x67): undefined reference to `basic_ostream<char, char_traits<char> >::operator<<(unsigned long)'
/tmp/ccWA5q6N.o(.gnu.linkonce.t.__ls__t13basic_ostream2ZcZt11char_traits1Zci+0x7c): undefined reference to `basic_ostream<char, char_traits<char> >::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

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2001-08-02 13:59 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-08-01 15:39 compiling programs with libstdc++ Jason M'Sadoques
2001-08-01 19:25 ` aoliva
2001-08-02 13:07   ` Re[2]: " Jason M'Sadoques
2001-08-02 13:59     ` Alexandre Oliva

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).