I am beginner with ROOT macros.
When I try to compile the following code,
|#include "TCanvas.h"
#include "TROOT.h"
#include "TGraphErrors.h"
#include "TF1.h"
#include "TLegend.h"
#include "TArrow.h"
#include "TLatex.h"
#include "TH1.h"
void macro5(){
auto cnt_r_h= new TH1F("count_rate","Count Rate;N_{Counts};#occurences",100,-0.5,15.5);
auto mean_count=3.6f;
TRandom3 rndgen;
for(int imeas=0;imeas<400;imeas++){cnt_r_h->Fill(rndgen.Poisson(mean_count));}
auto c= new TCanvas();
cnt_r_h->Draw();
auto c_norm= new TCanvas();
cnt_r_h->DrawNormalized();
cout << "Moments of distribution: \n "
<< "Mean "<< cnt_r_h->GetMean();
}
the following error appears
You are probably missing the definition of std::__1::basic_ostream<char, std::__1::char_traits<char> >& std::__1::operator<<<std::__1::char_traits<char> >(std::__1::basic_ostream<char, std::__1::char_traits<char> >&, char const*)
Maybe you need to load the corresponding shared library?
But it happens only in the MacOs pc I am using.
Expected output is displayed when I execute the same code in my school’s official server.
Would anyone please help me to find out the exact reason behind the problem?
Thank you.