Hi,
the great thing about ROOT is that it keeps making you a newbie every few years.
I used to be able have a working macro for ROOT and a compilable version that would have run on its own:
#ifdef __CINT__
void wth() { // do it easy
#else
#include "TH1F.h"
int main () { // do it fast
#endif
TH1F* aPointer = new TH1F("a","a",10,0.,1.);
aPointer->Draw();
return 0;
}
but I have now ROOT 6.14 and it doesn’t work, CINT is undefined:
root [0] .X wth.cc
warning: cannot find function ‘wth()’; falling back to .L
Looking at post, I found one that seemed to suggest to use ROOTCLING instead, but it doesn’t seem to work either.
Oh, and it doesn’t compile too!
set command = "g++ -g -I$ROOTSYS/include `root-config --libs` $1 -o $program"
echo -n "compiling......."
$command
echo "done!"
compiling......./tmp/cc8kpW7w.o: In function `main':
/home/acal/SHiP_tb2018/wth.cc:12: undefined reference to `TH1F::TH1F(char const*, char const*, int, double, double)'
/home/acal/SHiP_tb2018/wth.cc:12: undefined reference to `TObject::operator delete(void*)'
/tmp/cc8kpW7w.o: In function `__static_initialization_and_destruction_0(int, int)':
/cern/root/include/TVersionCheck.h:42: undefined reference to `TVersionCheck::TVersionCheck(int)'
/tmp/cc8kpW7w.o: In function `TObject::operator new(unsigned long)':
/cern/root/include/TObject.h:152: undefined reference to `TStorage::ObjectAlloc(unsigned long)'
collect2: error: ld returned 1 exit status
done!
any help much appreciated!