Changing fit attributes in compiled code

Strange problem:

If I use fits in my macro and change properties then I do it like that (and later use it to fit a TGraph object, of course) and it works perfectly:

  TF1 *fit1 = new TF1("mypol","pol7");
  mypol->SetLineWidth(2);

However, if I use the same lines in compiled code, the compiler complains

TEventViewTool.C: In member function void TEventViewTool::scanEff(double, double, double, double, double)': TEventViewTool.C:1735: error:mypol’ undeclared (first use this function)
TEventViewTool.C:1735: error: (Each undeclared identifier is reported only once for each function it appears in.)
gmake: *** [TEventViewTool.o] Error 1

How can I solve this problem?
Thx, Martin

Ok stupid me…

TGraph *mypol;

solves the problem, of course…