I need to say a massive thank you for this topic (even though it is old, so apologies for necro-ing it).
I have just got a new MacBook Pro and was configuring ROOT on it and I thought the best way to check was to compile and run some standalone code I had written (using RooFit) to run a brief analysis.
Upon including all the libraries possible, I was getting an issue (which I will put here incase others get the same problem, because this took a lot of googling to find).
Undefined symbols for architecture x86_64:
"RooRealVar::RooRealVar(char const*, char const*, double, char const*)", referenced from:
_main in analyser.o
"RooCmdArg::RooCmdArg()", referenced from:
_main in analyser.o
"RooFit::Cut(char const*)", referenced from:
_main in analyser.o
"RooFit::Import(TTree&)", referenced from:
_main in analyser.o
"RooArgSet::RooArgSet(RooAbsArg const&, RooAbsArg const&, RooAbsArg const&, RooAbsArg const&, char const*)", referenced from:
_main in analyser.o
"RooDataSet::RooDataSet(char const*, char const*, RooArgSet const&, RooCmdArg const&, RooCmdArg const&, RooCmdArg const&, RooCmdArg const&, RooCmdArg const&, RooCmdArg const&, RooCmdArg const&, RooCmdArg const&)", referenced from:
_main in analyser.o
"RooArgSet::~RooArgSet()", referenced from:
_main in analyser.o
"RooCmdArg::~RooCmdArg()", referenced from:
_main in analyser.o
"RooAbsData::numEntries() const", referenced from:
_main in analyser.o
"RooDataSet::~RooDataSet()", referenced from:
_main in analyser.o
"RooArgSet::RooArgSet(RooAbsArg const&, char const*)", referenced from:
_main in analyser.o
"RooRealVar::~RooRealVar()", referenced from:
_main in analyser.o
ld: symbol(s) not found for architecture x86_64
collect2: ld returned 1 exit status
make: *** [analyser.exe] Error 1
Anyway, it turns out that when this code was compiled in Linux, I only needed to include the -lRooFit option, but apparently on Macs, it requires the -lRooFitCore option.
If anyone with more knowledge could shed some light as to what the difference is, I would be very grateful, but as it is, the advise above has resolved my compilation problem.