TCanvas problem

I am writing a compiled program that creates several TCanvases. When running the code, the following error message always occurs at the first TCanvas:
*** Interpreter error recovered ***
If there is a graph/histogram associated with that TCanvas, it does not get made.
Subsequent TCanvases create no error message and the histograms and graphs I make are printed properly.

Here is syntax I’m using, which is pretty straightforward from the examples.
TCanvas *c1 = new TCanvas(“c1”,“c1”);

My file includes the line
#include “TCanvas.h”



The line you quote works fine as it is. The problem must be somewhere else in your code. (lines before?).


Thank you for the response.

I’ve moved the line
TCanvas *c1 = new TCanvas(“c1”,“c1”);
around in the code to see if I can find some point higher up in the code where the error occurs.

I am reading a file off of castor at CERN and I use the following line:
TFile *f = TFile::Open(filename);
where filename is just a string with the path.

If the line creating a TCanvas is above the line opening the TFile, there is no error message and all subsequent TCanvases created after the TFile line are created without issue. If the first TCanvas is created below the TFile line, then I get the “interpreter error recovered” message.

Either way, I can make the code work by having a dummy TCanvas created somewhere, but I don’t know why this is the case. The code I use to open the TFile is pretty standard, so I’m not sure why I get an error message.

[quote]The code I use to open the TFile is pretty standard, so I’m not sure why I get an error message.[/quote]It probably has to do with the content of the file …