Dear Support,
I am running into a weird thing during compilation, please find below a minimum file reproducing the problem.
#include "TROOT.h"
#include <TSystem.h>
#include <TClonesArray.h>
#include "RooRealVar.h"
#include "RooDataSet.h"
using namespace std;
using namespace RooFit;
int main()
{
TClonesArray pof("RooRealVar", 10);
new (pof[0]) RooRealVar();
TClonesArray paf("RooDataSet", 10);
new (paf[0]) RooDataSet();
}
I am under OS X 10.8.2, and load root using
export ROOTSYS=/afs/cern.ch/sw/lcg/app/releases/ROOT/5.34.05_python2.7/x86_64-mac106-gcc42-opt/root
source ${ROOTSYS}/bin/thisroot.sh
While trying to compile I obtain the following
g++ -Wall -g `root-config --cflags` -c test.C -o test.o
test.C: In function ‘int main()’:
test.C:16: error: no matching function for call to ‘RooDataSet::operator new(long unsigned int, TObject*&)’
/afs/cern.ch/sw/lcg/app/releases/ROOT/5.34.05_python2.7/x86_64-mac106-gcc42-opt/root/include/RooDataSet.h:33: note: candidates are: static void* RooDataSet::operator new(size_t)
am I forgetting something ? It seems weird to me that the crash happens for RooDataSet but not RooRealVar, which anyway both derive from TObject…
I also want to say that the code compiles fine if I use 5.27.06 instead of 5.34.05_python2.7… But I did not try other releases.
Any idea is welcome !
Thanks in advance,
Olivier