ROOT Version: 6.18/04
Platform: VSCode
Compiler: VSCode
System: Mac OSX
I am a beginner to ROOT and after downloading it on my Mac and running the following macro:
#include <iostream>
#include <cmath>
using namespace std;
void f1(){
c1 = new TCanvas("c1", "My RoOt Plots", 1500, 500);
c1 -> Divide(3,1);
c1 -> cd(1);
f = new TF1("f", "sin(x)", 0, 5);
f -> SetLineColor(kBlue + 3);
f -> SetTitle("MyFunction; xval; yval");
f -> Draw();
c1 -> cd(2);
g = new TF1("g", "cos(x)", 0, 5);
g -> SetLineColor(kMagenta);
g -> SetTitle("2ndFunction; xval2; yval");
g -> Draw();
c1 -> cd(3);
h = new TF2("h", "x^2 + y^2", 0, 5, 0, 5);
h -> SetLineColor(kPink);
h -> SetTitle("OtherFunction; x; y");
h -> Draw("surf1");
cout << "\n";
}
When I run the command .x f1.C in the Mac terminal, it gives the following errors:
/Users/myname/Documents/root2/macros/f1.C:7:5: error: use of undeclared identifier 'c1’
c1 = new TCanvas(“c1”, “My RoOt Plots”, 1500, 500);
^
/Users/myname/Documents/root2/macros/f1.C:8:5: error: use of undeclared identifier 'c1’
c1 -> Divide(3,1);
^
/Users/myname/Documents/root2/macros/f1.C:10:5: error: use of undeclared identifier 'c1’
c1 -> cd(1);
^
Furthermore, the top two lines are underlined in red because I need to update my include path and that I cannot open the source file for either. How do I fix this?
Also, what lines should I have out in my .bash profile to make this work?