I have a very simple code that creates a canvas and save the canvas into a .C file.
If I run the code with Cint there is no problem, but when I compile it with g++ and run the main program, all the colors in the .C file are set to #0 like:
ci = TColor::GetColor("#000000");
hist->SetFillColor(ci);
ci = TColor::GetColor("#000000");
hist->SetLineColor(ci);
Below you can see an example of the code I was referring to. Any idea of what could be happening?
I am using root-5.20 slc4
#include <TH1F.h> #include <TCanvas.h>
int main(int argc, char *argv[])
{
TCanvas *c2 = new TCanvas();
TH1F *hist = new TH1F(“hist”,“hist”,20,0,1);
hist->Fill(0.4);
thanks for the reply.
I tried to add the line you suggest at the beginning of the main, but It does not help. I still get
the color code
ci = TColor::GetColor("#000000");
in the generated macro .C.