Axis Title

Hi,

I have a question about the axis title.

gr = new TGraphErrors(…);
c1 = new TCanvas();

gr->SetTitle("#pi^{+}");

gr->GetXaxis()->SetTitle(“mt - m0 [GeV/c^2]”);
gr->GetXaxis()->CenterTitle(true);

it works if I don’t compile the code
root>.L filename.C

but, it shows the error message and it has the compile error when I compile the code
root>.L filename.C+

The error message is

root [0] .L bwfitpiplus02.C+
Info in TUnixSystem::ACLiC: creating shared library /home/tsuchiya/analysis/blastwave/minuit/./bwfitpiplus02_C.so
In file included from /home/tsuchiya/analysis/blastwave/minuit/fileGFj9tO.h:32,
from /home/tsuchiya/analysis/blastwave/minuit/fileGFj9tO.cxx:16:
/home/tsuchiya/analysis/blastwave/minuit/bwfitpiplus02.C: In function void drawgraph(int, const double*, const double*, const double*, const double*)': /home/tsuchiya/analysis/blastwave/minuit/bwfitpiplus02.C:49: invalid use of undefined typestruct TAxis’
/lsw/usr/root-5.1600/include/TF1.h:45: forward declaration of struct TAxis' /home/tsuchiya/analysis/blastwave/minuit/bwfitpiplus02.C:50: invalid use of undefined typestruct TAxis’
/lsw/usr/root-5.1600/include/TF1.h:45: forward declaration of `struct TAxis’
g++: /home/tsuchiya/analysis/blastwave/minuit/./fileGFj9tO.o: No such file or directory
Error in : Compilation failed!

What happens and how should I fix it?

Thank you!
/Nobu/

in your function add

#include "TAxis.h"
Rene

Thank you, it works!
/Nobu/