Latest snapshot won't build with --enable-libstdcxx-v3
Benjamin Scherrey
scherrey@switchco.com
Thu Sep 21 11:59:00 GMT 2000
Possible Repost - This message didn't seem to make it to the gcc list.
Attached is the source/compiler output. Apparently it finds all the
libraries its looking for
but not the required symbols. Dunno why that is.
thanx & later,
Ben Scherrey
Benjamin Kosnik wrote:
> On Wed, 20 Sep 2000, Benjamin Scherrey wrote:
>
> > That got the compiler to build and install but there are still problems. It appears that
> > libstdc++ v3 has been installed correctly in /usr/local/lib. I can compile my test code
> > but the link fails with the stream stuff. My test code exercises <string>, <sstream>,
> > and <iostream>.
>
> what's the link failure?
>
> what's the output of gcc -v -H?
>
> -benjamin
//
// Assign.cpp - Tests implementation of assignment operator.
//
#include <iostream>
#include <string>
#include <sstream>
using namespace std;
class Test
{
public:
Test( const int t = 0 ) : i(t)
{
cout << "Test default constructor." << endl;
}
Test( const Test& t )
{
cout << "Test copy constructor." << endl;
i = t.i;
}
Test& operator=( const Test& t )
{
cout << "Test assignment operator." << endl;
i = t.i;
return *this;
}
string print( void ) const
{
stringstream s;
s << "i = " << i;
/*
char buf[10];
itoa( i, buf, 10 );
string s = "i = ";
s += buf;
*/
return s.str();
}
private:
int i;
};
class Derived : public Test
{
public:
Derived( int t1 = 0, int t2 = 0 ) : Test( t1 ), j( t2 )
{
cout << "Derived default constructor." << endl;
}
Derived( const Derived& d ) : Test( d )
{
cout << "Derived copy constructor." << endl;
j = d.j;
}
Derived& operator=( const Derived& d )
{
cout << "Derived assignment operator." << endl;
j = d.j;
Test::operator=( d );
return *this;
}
string print( void ) const
{
/*
char buf[ 10 ];
itoa( j, buf, 10 );
string s = "j = ";
s += buf;
s += " - ";
s += Test::print();
*/
stringstream s;
s << "j = " << j << " - " << Test::print();
return s.str();
}
private:
int j;
};
int main( void )
{
Derived D1( 5,5 );
Derived D2( 7,7 );
cout << "D1 = " << D1.print() << endl;
cout << "D2 = " << D2.print() << endl;
cout << "D1 = D2" << endl;
D1 = D2;
cout << "D1 = " << D1.print() << endl;
cout << "D2 = " << D2.print() << endl;
return 0;
}
// eof( Assign.cpp )
More information about the Gcc
mailing list