build and usage on solaris 8

Bruno.Voigt@ic3s.de Bruno.Voigt@ic3s.de
Mon Apr 3 03:48:00 GMT 2000


Hi Benjamin,

I think I am missing some understanding how the build and usage of the
libstdc++
is to be done..On solaris7 and linux/intel I was able to build a version
and use it sucessfully.

Now I do not know if it only worked by incident because on solaris 8 I
always
get errors if I try to compile my applications.

Perhaps someone can shed some light on me how the different include dirs
etc
are meant to work/be used.

My structure:

gnu make v3.78
/home/bruno/gcc-2.95.2   with current cvs libstdc++
/home/bruno/bld-gcc

chgd libstdc++/src/Makefile.in: removed -Werror
chgd libstdc++/mkheck: set INC_PATH=""

cd /home/bruno/bld-gcc
../gcc-2.95.2/configure --prefix=/usr/local
make bootstrap
make check-install
make install

cd /home/bruno/testl

I try to compile and link the following little sample test.cpp:

#include <iostream>
#include <sstream>

int main(void)
{
  ostringstream t;
  t << "Hello, world";
  cout << t.str() << endl;
}

g++ -O2 test.cpp

Undefined           first referenced
 symbol                 in file
basic_streambuf<char, char_traits<char> >::xsgetn(char *, int)/var/tmp/ccG58pFH.o
locale::classic(void)               /var/tmp/ccG58pFH.o
locale::_S_global                   /var/tmp/ccG58pFH.o
basic_stringbuf<char, char_traits<char>, allocator<char> >::pbackfail(unsigned int)/var/tmp/ccG58pFH.o
locale::operator==(locale const &) const/var/tmp/ccG58pFH.o
ios_base::ios_base(void)            /var/tmp/ccG58pFH.o
basic_ostream<char, char_traits<char> > & operator<<<char_traits<char> >(basic_ostream<char, char_traits<char> > &, char const *)/var/tmp/ccG58pFH.o
ios_base::Init::~Init(void)         /var/tmp/ccG58pFH.o
basic_ostream<char, char_traits<char> >::put(char)/var/tmp/ccG58pFH.o
basic_ios<char, char_traits<char> >::widen(char) const/var/tmp/ccG58pFH.o
ios_base::Init::Init(void)          /var/tmp/ccG58pFH.o
locale::_Impl::~_Impl(void)         /var/tmp/ccG58pFH.o
basic_stringbuf<char, char_traits<char>, allocator<char> >::seekoff(long, _Ios_Seekdir, _Ios_Openmode)/var/tmp/ccG58pFH.o
basic_ostream<char, char_traits<char> >::flush(void)/var/tmp/ccG58pFH.o
basic_ios<char, char_traits<char> >::init(basic_streambuf<char, char_traits<char> > *)/var/tmp/ccG58pFH.o
basic_stringbuf<char, char_traits<char>, allocator<char> >::seekpos(fpos<__mbstate_t>, _Ios_Openmode)/var/tmp/ccG58pFH.o
basic_stringbuf<char, char_traits<char>, allocator<char> >::overflow(unsigned int)/var/tmp/ccG58pFH.o
ctype<char> const & use_facet<ctype<char> >(locale const &)/var/tmp/ccG58pFH.o
locale::_S_classic                  /var/tmp/ccG58pFH.o
basic_ostream<char, char_traits<char> > & operator<<<char, char_traits<char>, allocator<char> >(basic_ostream<char, char_traits<char> > &,
basic_string<char, char_traits<char>, allocator<char> > const &)/var/tmp/ccG58pFH.o
basic_ostream<char, char_traits<char> >::operator<<(basic_ostream<char, char_traits<char> > &(*)(basic_ostream<char, char_traits<char> >
&))/var/tmp/ccG58pFH.o
locale::operator=(locale const &)   /var/tmp/ccG58pFH.o
ios_base::~ios_base(void)           /var/tmp/ccG58pFH.o
basic_streambuf<char, char_traits<char> >::xsputn(char const *, int)/var/tmp/ccG58pFH.o
ld: fatal: Symbol referencing errors. No output written to a.out
collect2: ld returned 1 exit status

g++ -O2 test.cpp -L /usr/local/lib/libstdc++.a
and
g++ -O2 test.cpp /usr/local/lib/libstdc++.a

do not work either. same result

How with what options do I have to compile this sampel to have the linker
find the
correct libarries to resolve the above undefined referecences??

which ld: /usr/ucb/ld

Or am I supposed to use the GNU ld ?

I would appreciate a step by step description how to use the build
libstdc++,
I must be missing some big point..

TIA, Bruno
--
Bruno.Voigt@ic3s.de  # IC3S AG # Tel. +49.4106.655.105 # Fax. +49.4106.4618
http://www.ic3s.de   # Mobile +49.700.686.00.686


                                                                                                                   
                    Benjamin                                                                                       
                    Kosnik               To:     Bruno.Voigt@ic3s.de                                               
                    <bkoz@cygnus.        cc:     libstdc++@sourceware.cygnus.com                                   
                    com>                 Subject:     Re: Cannot build both gcc and new snapshot on                
                                         i686-pc-linux-gnu                                                         
                    30.03.2000                                                                                     
                    05:53                                                                                          
                                                                                                                   
                                                                                                                   




Hey Bruno. This is not anything to do with the library or compiler
per-se, but instead about an inadequacy in the test harness.

This was covered in a round-about way on the list a bit ago:
http://sourceware.cygnus.com/ml/libstdc++/2000-q1/msg00430.html

Anyway, a solution is to make a small change to mkcheck, and then run
"make check-install"

-benjamin

*** mkcheck          Wed Mar 29 17:38:01 2000
--- mkcheck.orig          Wed Mar 29 17:36:43 2000
*************** fi
*** 55,62 ****
  if [ $WHICH != "1" ]; then
    INC_PATH="-I$BUILD_DIR -I$SRC_DIR/config/gnu-linux
-I$SRC_DIR/config/cpu/i386  -I$SRC_DIR/std -I$SRC_DIR -I$SRC_DIR/stl
-I$SRC_DIR/libio"
  elif [ $WHICH -eq 1 ]; then
! #  INC_PATH="-I$PREFIX_DIR/include/g++-v3"
!    INC_PATH=""
  fi

  #LIB_PATH == where to find the build library binaries.
--- 55,61 ----
  if [ $WHICH != "1" ]; then
    INC_PATH="-I$BUILD_DIR -I$SRC_DIR/config/gnu-linux
-I$SRC_DIR/config/cpu/i386  -I$SRC_DIR/std -I$SRC_DIR -I$SRC_DIR/stl
-I$SRC_DIR/libio"
  elif [ $WHICH -eq 1 ]; then
!   INC_PATH="-I$PREFIX_DIR/include/g++-v3"
  fi

  #LIB_PATH == where to find the build library binaries.


On Wed, 29 Mar 2000 Bruno.Voigt@ic3s.de wrote:

>
> Hi there,
> has anyone a solution to this problem?
> I still have no luck with gcc 2.95.2 + any of the libstdc 2.90.8
snapshots
> or current cvs versions
> on solaris 8.
> I still get the same error message.
> Is this a sol8 specific or compiler specific error?
> I followed the mailing list but did not see a solution, is there anything
I
> missed?
> If so I would appreciate some hints...
>
> TIA, Bruno
>
> --
> Bruno.Voigt@ic3s.de  # IC3S AG # Tel. +49.4106.655.105 # Fax.
+49.4106.4618
> http://www.ic3s.de   # Mobile +49.700.686.00.686
>
>
>
>

>                     Benjamin Kosnik

>                     <bkoz@cygnus.com>                  To:     Russell
Davidson <russell@ehess.cnrs-mrs.fr>
>                     Sent by:                           cc:
libstdc++@sourceware.cygnus.com
>                     libstdc++-owner@sourceware.        Subject:     Re:
Cannot build both gcc and new snapshot on
>                     cygnus.com                         i686-pc-linux-gnu

>

>

>                     25.03.2000 21:58

>

>

>
>
>
>
> > GNU C++ version 2.95.2 19991024 (release) (i686-pc-linux-gnu) compiled
by
> > GNU C version 2.95
> > .2 19991024 (release).
> > In file included from
> > /home/russell/local/include/g++-v3/bits/std_ios.h:43,
> >                  from
> > /home/russell/local/include/g++-v3/bits/std_istream.h:37,
> >                  from
> > /home/russell/local/include/g++-v3/bits/std_fstream.h:37,
> >                  from /home/russell/local/include/g++-v3/fstream:2,
> >                  from
> > ../../../../gcc-2.95.2/libstdc++/testsuite/17_intro/header_fstream.cc:
> > 23:
> > /home/russell/local/include/g++-v3/bits/ios_base.h:144: parse error
> before `{'
> > /home/russell/local/include/g++-v3/bits/ios_base.h:152: destructor
> `failure' must match clas
> > s name `ios_base'
> > /home/russell/local/include/g++-v3/bits/ios_base.h:226: parse error
> before `protected'
> > /home/russell/local/include/g++-v3/bits/ios_base.h:239: syntax error
> before `;'
> > /home/russell/local/include/g++-v3/bits/ios_base.h:243: parse error
> before `,'
> > /home/russell/local/include/g++-v3/bits/ios_base.h:245: missing ';'
> before right brace
> > /home/russell/local/include/g++-v3/bits/ios_base.h:248: ANSI C++
forbids
> declaration `_Callb
> > ack_list' with no type
> > /home/russell/local/include/g++-v3/bits/ios_base.h:248: semicolon
missing
> after declaration
> > of `std::_Callback_list'
>
> Yep. I had independant confirmation of this. Does anybody have a stable
> CVS gcc tree to try it with?
>
> -benjamin
>
>
>
>
>






More information about the Libstdc++ mailing list