ROOT I use a Mac OX 10.4, I have tried to create a source using libraries, for example:
TCanvas *myc = new TCanvas(“myc”, “Prova”, 800, 600);
TPad *c1_1 = new TPad(“c1_1”, “c1_1”,0.01,0.51,0.49,0.99);
TPad *c1_2 = new TPad(“c1_2”, “c1_2”,0.51,0.51,0.99,0.99);
TPad *c1_3 = new TPad(“c1_3”, “c1_3”,0.01,0.01,0.49,0.49);
TPad *c1_4 = new TPad(“c1_4”, “c1_4”,0.51,0.01,0.99,0.49);
Using the appropriate compiler options new a.out but when the launch does not create the canvas.
rename your function to e.g. prova() (instead of main()), save your source into prova.C, start ROOT, and simply do:
root  .x prova.C+
No need to compile or link anything (or fix the issue with missing graphics) - ROOT will take care of it.
Thank for your answer, I want to use a source not a macro root.
Can be done?
prova.C is a source file. “Macro” is just a misleading word - prova.C+ will invoke your compiler and linker and generate a shared library. There is NO difference in performance nor code validity checks to what you are trying to do.
If you really do need a stand-alone binary: could you tell us your use case? You will need a TApplication object and you will need to keep your program running, or all windows will vanish before they show up (see TVirtualPad::WaitPrimitive()). But again: don’t do it. Use the “+”.