This is the mail archive of the
libstdc++@gcc.gnu.org
mailing list for the libstdc++ project.
gcc-3.0 pre and mem_fun()
- To: "libstdc++ at gcc dot gnu dot org" <libstdc++ at gcc dot gnu dot org>
- Subject: gcc-3.0 pre and mem_fun()
- From: "R. Sinoradzki" <sinoradz at student dot uni-kl dot de>
- Date: Sun, 27 May 2001 14:04:42 +0200
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