This is the mail archive of the gcc-help@gcc.gnu.org mailing list for the GCC project.


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

Re: Case history: Installing libstdc++ on i686-pc-linux-gnu (Red Hat)


Benjamin Kosnik wrote:

> libstdc++-2.90.8 is libstdc++-v3: . . . libstdc++.so.3.0.0
> libstdc++-v2 is in the gcc releases. . . libstdc++.a.2.10.0

Thanks a lot, Ben.  I'm really trying.


> this list is for libstdc++-v3. The occasional confused question about v2
> is permitted, but not actively encouraged...

OK, now I know better.  (So IS there a list for v2?)

Anyway, I successfully built v3, including the gcc rebuild, but my
libraries are all messed up now.  Is there anyone who's willing to help
me?  I have a vanilla Red Hat 6.0 system, plus the gcc-2.95 devel RPMs,
plus v3.  A simple hello.cpp program generates the following on compile:

$ g++ -I/usr/libstdc++-2.90.8/include/g++-v3 -L/usr/libstdc++-2.90.8/lib
Hello.cpp
/tmp/cc2CbfSP.o: In function `main':
/tmp/cc2CbfSP.o(.text+0x26): undefined reference to `cout'
/tmp/cc2CbfSP.o(.text+0x2b): undefined reference to `basic_ostream<char,
char_traits<char> > & operator<<<char_traits<char> >(basic_ostream<char,
char_traits<char> > &, char const *)'
/tmp/cc2CbfSP.o(.text+0x36): undefined reference to `basic_ostream<char,
char_traits<char> >::operator<<(basic_ostream<char, char_traits<char> >
&(*)(basic_ostream<char, char_traits<char> > &))'
/tmp/cc2CbfSP.o: In function `Hello::~Hello(void)':
/tmp/cc2CbfSP.o(.text+0xbf): undefined reference to `cout'
/tmp/cc2CbfSP.o(.text+0xc4): undefined reference to `basic_ostream<char,
char_traits<char> > & operator<<<char_traits<char> >(basic_ostream<char,
char_traits<char> > &, char const *)'
/tmp/cc2CbfSP.o(.text+0xcf): undefined reference to `basic_ostream<char,
char_traits<char> >::operator<<(basic_ostream<char, char_traits<char> >
&(*)(basic_ostream<char, char_traits<char> > &))'
/tmp/cc2CbfSP.o: In function
`__static_initialization_and_destruction_0':
/tmp/cc2CbfSP.o(.text+0x116): undefined reference to
`ios_base::Init::Init(void)'
/tmp/cc2CbfSP.o(.text+0x12b): undefined reference to
`ios_base::Init::~Init(void)'
/tmp/cc2CbfSP.o: In function `basic_ostream<char, char_traits<char> > &
flush<char, char_traits<char> >(basic_ostream<char, char_traits<char> >
&)':
/tmp/cc2CbfSP.o(.basic_ostream<char, char_traits<char> > &
gnu.linkonce.t.flush<char, char_traits<char> >(basic_ostream<char,
char_traits<char> > &)+0xe): undefined reference to `basic_ostream<char,
char_traits<char> >::flush(void)'
/tmp/cc2CbfSP.o: In function `basic_ostream<char, char_traits<char> > &
endl<char, char_traits<char> >(basic_ostream<char, char_traits<char> >
&)':
/tmp/cc2CbfSP.o(.basic_ostream<char, char_traits<char> > &
gnu.linkonce.t.endl<char, char_traits<char> >(basic_ostream<char,
char_traits<char> > &)+0x18): undefined reference to `basic_ios<char,
char_traits<char> >::widen(char) const'
/tmp/cc2CbfSP.o(.basic_ostream<char, char_traits<char> > &
gnu.linkonce.t.endl<char, char_traits<char> >(basic_ostream<char,
char_traits<char> > &)+0x2a): undefined reference to
`basic_ostream<char, char_traits<char> >::put(char)'
/usr/libstdc++-2.90.8/lib/libstdc++.so: undefined reference to
`std::bad_alloc::~bad_alloc(void)'
/usr/libstdc++-2.90.8/lib/libstdc++.so: undefined reference to
`std::exception type_info function'
/usr/libstdc++-2.90.8/lib/libstdc++.so: undefined reference to
`std::bad_cast type_info node'
/usr/libstdc++-2.90.8/lib/libstdc++.so: undefined reference to
`std::bad_cast virtual table'
/usr/libstdc++-2.90.8/lib/libstdc++.so: undefined reference to
`std::bad_alloc virtual table'
/usr/libstdc++-2.90.8/lib/libstdc++.so: undefined reference to
`std::exception type_info node'
/usr/libstdc++-2.90.8/lib/libstdc++.so: undefined reference to
`std::bad_cast type_info function'
/usr/libstdc++-2.90.8/lib/libstdc++.so: undefined reference to
`std::terminate(void)'
/usr/libstdc++-2.90.8/lib/libstdc++.so: undefined reference to
`std::uncaught_exception(void)'
/usr/libstdc++-2.90.8/lib/libstdc++.so: undefined reference to
`std::exception virtual table'
collect2: ld returned 1 exit status



> > > So it seems that libstdc++ really CAN'T be built without the gcc
> > > source, unless the configure script is hacked or something, which
> > > seems overwhelming.
> 
> This part of the install documentation is now removed. Sorry for the
> confusion.
> 
> Please hang with us on the config/build/install docs. This part of
> libstdc++-v3 has undergone a lot of change in the last two months, and
> the documentation is still reeling from the changes. We're working to
> make the install process less painful--thanks to everybody who sent in
> feedback.

And your hard work is greatly appreciated.  I can't *imagine* installing
without your docs!  I've read them and reread them numerous times to get
things straight.  (Let me know if you want specific comments.)

Anyway, thanks for your response.

--Avi

p.s.  After I installed v3, I found that
/usr/lib/libstdc++-libc6.1-1.so.2
      had been removed.  I couldn't find any reference to that file in
the
      v3 source tree, but it could have been wiped by one of the 2.95.2
      RPMs.  Unfortunately it's needed for groff, which is used by
man(1).
      Anyway, any help is appreciated; if the problem was caused by some
      other install, I apologize in advance for bothering you.

$ man g++
/usr/bin/groff: error in loading shared libraries:
libstdc++-libc6.1-1.so.2: cannot open shared object file: No such file
or directory
/usr/bin/gtbl: error in loading shared libraries:
libstdc++-libc6.1-1.so.2: cannot open shared object file: No such file
or directory

$ ldd /usr/bin/groff
	libstdc++-libc6.1-1.so.2 => not found
	libm.so.6 => /lib/libm.so.6 (0x40018000)
	libc.so.6 => /lib/libc.so.6 (0x40034000)
	/lib/ld-linux.so.2 => /lib/ld-linux.so.2 (0x40000000)




=========  Avi Green :) (: www.sputnik7.com  =========
=    Junior Unix S/A       Novice System Specialist  =
========  avi at sputnik7.com   212 217-1147  ========

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