installation of libstdc++-v3 breaks simple build

Peter Kurpis pkurpis@keck.hawaii.edu
Wed Aug 2 15:07:00 GMT 2000


I installed  gcc-2.95.2.tar.gz  and built several C++ (and C) 
programs successfully.  I then installed  libstdc++-2.90.8.tar.gz 
and broke even the build of  hello.cc !

Details are:

I am on a Sparc Ultra 10 workstation running Solaris 2.7.

The procedure I used was (what I understood to be) pretty much SOP:

	cd /usr/local/gcc
	tar xzf gcc-2.95.2.tar.gz
	mkdir build-2.95.2
	cd build-2.95.2
	/usr/local/gcc/gcc-2.95.2/configure --enable-shared --enable-languages=c++,f77
	gmake bootstrap
	gmake install

Things went normally, and the build products were installed
(apparently to me) properly.

At this point, I tested building a few things, a substantial
C++ project, and also the following  hello.cc :

	tcsh: cat hello.cc
	#include <iostream>

	int main(int argc, char *argv[])
		{
		cout << "hello, world!" << endl;
		}

	tcsh: 

Everything was fine.

Then I did the libstdc++ build...

	cd /usr/local/gcc/gcc-2.95.2
	mv libstdc++ libstdc++-v2
	mv libio libio-v2
	gtar xzf ../libstdc++-2.90.8.tar.gz
	ln -s libstdc++-2.90.8 libstdc++
	cd libstdc++/src

In this directory, I edited Makefile.in to read
	WERROR=
instead of 
	WERROR= -Werror

	cd /usr/local/gcc/build-2.95.2
	/usr/local/gcc/gcc-2.95.2/configure --enable-languages=c++ --enable-shared
	gmake bootstrap

At this point, I checked in the  build-2.95.2  tree for a new
 libgcc.a  then continued with

	gmake install

Again, everything appeared fine in the build.

After the  gmake install , in  /usr/local/lib , there were new
files  libstdc++.so.3.0.0  and associated links, plus  libstdc++.la
 libiberty.a  and  libstdc++.a  (in addition to the "older"
 libstdc++.2.10.0.a  and  libstdc++.2.10.0.so ).  In  /usr/local/include
there was a new  g++-v3  directory.  Also, in /usr/local/bin , a 
number of tools had new timestamps, including  gcc  and  g++ .  In
 /usr/local/lib/gcc-lib/*/* , the files have new timestamps.

(I had (perhaps unwisely) skipped the  gmake check  or 
 gmake check-install  steps, because I did not have  bash  installed.)

At this point, just compiling the above  hello.cc  results in:

tcsh: g++ hello.cc
/var/tmp/ccdmkV6Z.o: In function `main':
/var/tmp/ccdmkV6Z.o(.text+0x168): undefined reference to `basic_ostream<char, char_traits<char> > & operator<<<char_traits<char> >(basic_ostream<char, char_traits<char> > &, char const *)'
/var/tmp/ccdmkV6Z.o(.text+0x180): undefined reference to `basic_ostream<char, char_traits<char> >::operator<<(basic_ostream<char, char_traits<char> > &(*)(basic_ostream<char, char_traits<char> > &))'
/var/tmp/ccdmkV6Z.o: In function `__static_initialization_and_destruction_0':
/var/tmp/ccdmkV6Z.o(.text+0x1d8): undefined reference to `ios_base::Init::Init(void)'
/var/tmp/ccdmkV6Z.o(.text+0x1f4): undefined reference to `ios_base::Init::~Init(void)'
/var/tmp/ccdmkV6Z.o: In function `basic_ostream<char, char_traits<char> > & flush<char, char_traits<char> >(basic_ostream<char, char_traits<char> > &)':
/var/tmp/ccdmkV6Z.o(.basic_ostream<char, char_traits<char> > & gnu.linkonce.t.flush<char, char_traits<char> >(basic_ostream<char, char_traits<char> > &)+0xc): undefined reference to `basic_ostream<char, char_traits<char> >::flush(void)'
/var/tmp/ccdmkV6Z.o: In function `basic_ostream<char, char_traits<char> > & endl<char, char_traits<char> >(basic_ostream<char, char_traits<char> > &)':
/var/tmp/ccdmkV6Z.o(.basic_ostream<char, char_traits<char> > & gnu.linkonce.t.endl<char, char_traits<char> >(basic_ostream<char, char_traits<char> > &)+0x14): undefined reference to `basic_ios<char, char_traits<char> >::widen(char) const'
/var/tmp/ccdmkV6Z.o(.basic_ostream<char, char_traits<char> > & gnu.linkonce.t.endl<char, char_traits<char> >(basic_ostream<char, char_traits<char> > &)+0x28): undefined reference to `basic_ostream<char, char_traits<char> >::put(char)'
collect2: ld returned 1 exit status
tcsh: 

Yikes.  I searched this mailing list's archives a little, and tried explicit
 -I  and  -L  flags to  g++ , as well as  -fhonor-std , each alone and in 
combination, with different but failing results.

I suspect I am making a simple mistake.  Thanks in advance for help and advice.


More information about the Gcc-help mailing list