I was using oprofile 9.3, but opreport too frequently had this error:
opreport error: basic_string::erase

Apparently, this is solved in 9.4, so I tried installing that. I could not find an RPM, so I
got the tar ball from oprofile.sourceforge.net

I am installing oprofile 9.4 on CentOS 2.6.18-53.el5PAE
I had some trouble building it.

I started with
./configure --with-kernel-support

I was getting an error because /usr/include/libiberty.h was not found during the configure step.
I fixed that by installing binutils-devel-2.17.50.0.6-6.el5

then I did make, but g++ was missing, so
I installed gcc-c++-4.1.2-42.el5 because g++ is needed to build oprofile.

Then I got the error shown below (at which point I figured I was going down the wrong track and needed help).
Can someone help? thanks!

...
make[2]: Entering directory `/root/oprofile-0.9.4/libutil++'
Making all in .
make[3]: Entering directory `/root/oprofile-0.9.4/libutil++'
source='op_bfd.cpp' object='op_bfd.o' libtool=no \
        DEPDIR=.deps depmode=none /bin/sh ../depcomp \
        g++ -DHAVE_CONFIG_H -I. -I. -I..  -I ../libutil -I ../libop -I ../libpp  -I../include  -c -o op_bfd.o op_bfd.cpp
In file included from /usr/lib/gcc/i386-redhat-linux/4.1.2/../../../../include/c++/4.1.2/backward/iostream.h:31,
                 from ../include/sstream:31,
                 from op_bfd.cpp:26:
/usr/lib/gcc/i386-redhat-linux/4.1.2/../../../../include/c++/4.1.2/backward/backward_warning.h:32:2: warning: #warning This file includes at least one deprecated or antiquated header. Please consider using one of the 32 headers found in section 17.4.1.2 of the C++ standard. Examples include substituting the <X> header for the <X.h> header for C++ includes, or <iostream> instead of the deprecated header <iostream.h>. To disable this warning use -Wno-deprecated.
../include/sstream:37: error: using typedef-name ‚std::stringbuf‚ after ‚class‚
/usr/lib/gcc/i386-redhat-linux/4.1.2/../../../../include/c++/4.1.2/iosfwd:140: error: ‚std::stringbuf‚ has a previous declaration here
../include/sstream:230: error: using typedef-name ‚std::istringstream‚ after ‚class‚
/usr/lib/gcc/i386-redhat-linux/4.1.2/../../../../include/c++/4.1.2/iosfwd:141: error: ‚std::istringstream‚ has a previous declaration here
../include/sstream:267: error: using typedef-name ‚std::ostringstream‚ after ‚class‚
/usr/lib/gcc/i386-redhat-linux/4.1.2/../../../../include/c++/4.1.2/iosfwd:142: error: ‚std::ostringstream‚ has a previous declaration here
../include/sstream:304: error: using typedef-name ‚std::stringstream‚ after ‚class‚
/usr/lib/gcc/i386-redhat-linux/4.1.2/../../../../include/c++/4.1.2/iosfwd:143: error: ‚std::stringstream‚ has a previous declaration here
make[3]: *** [op_bfd.o] Error 1
make[3]: Leaving directory `/root/oprofile-0.9.4/libutil++'
make[2]: *** [all-recursive] Error 1
make[2]: Leaving directory `/root/oprofile-0.9.4/libutil++'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/root/oprofile-0.9.4'
make: *** [all] Error 2

thanks,

Mark