public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
From: "Jason M'Sadoques" <jsado@mediaone.net>
To: gcc-help@gcc.gnu.org
Subject: compiling programs with libstdc++
Date: Wed, 01 Aug 2001 15:39:00 -0000	[thread overview]
Message-ID: <200108012239.f71MdsP28172@chmls16.mediaone.net> (raw)

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

             reply	other threads:[~2001-08-01 15:39 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-08-01 15:39 Jason M'Sadoques [this message]
2001-08-01 19:25 ` aoliva
2001-08-02 13:07   ` Re[2]: " Jason M'Sadoques
2001-08-02 13:59     ` Alexandre Oliva

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=200108012239.f71MdsP28172@chmls16.mediaone.net \
    --to=jsado@mediaone.net \
    --cc=gcc-help@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).