gcc-3.0 pre and mem_fun()

R. Sinoradzki sinoradz@student.uni-kl.de
Sun May 27 04:58:00 GMT 2001


Hi,

I tested some code from alt.comp.lang.learn.c-c++
It compiles and works with gcc-2.95.4.

It also compiles with gcc-3.0pre(cvs-version from yesterday)
but it does not execute.

the error is:

./memfun: error while loading shared libraries: ./memfun: 
          symbol __register_frame_info_bases, version GCC_3.0 not defined
          in file libgcc_s.so.0 with link time reference

So perhaps this is the wrong place and the problem is within the compiler.

O.K the code:

//////////////////////////////////////////////////////////////////

#include <iostream>
#include <functional>
#include <algorithm>
#include <list>

using namespace std;

class Base {
public:
 virtual void set() { cout << "Base::set()" << endl; }
};

class Derived : public Base {
public:
 virtual void set() { cout << "Derived::set()" << endl; }
};

int main()
{
 Base* b = new Base;
 Derived* d = new Derived;

 list<Base*> lst;
 lst.push_back(b);
 lst.push_back(d);

 for_each(lst.begin(), lst.end(), mem_fun(&Base::set));
}

/////////////////////////////////////////////////////////////////////////

bye, Ralf



More information about the Libstdc++ mailing list