Problem executing compiled ROOT GUI

I have made a ROOT gui for the ALICE/PHOS APD bias controll that runs without errors in the CINT interpreter.
The program also compiles without errors but when I execute the compiled
version of the program, the program terminates before the GUI is displayed.

The gui uses various ROOT classes for graphical user interactions
I have debugged program, it doesnt seem to crash or anything, just terminates.

I suspect that the program dont pass the execution thread to the ROOT guis in a proper way. I am relatively new to ROOT (and C++) but have some experince with C.

I have probably forgotten something fundamental. I need to know what is the
magic wand to give the execution controll to the GUI so that the program dont terminates My main() routne looks like this.

#include … all necessary stuff

int main()
printf("\nentering main\n");
PhosMain *APD_controll = new PhosMain();
printf("\nexiting main\n");
return 0;

PhosMain is not a subclass of any ROOT class.
The two printf lines is written to the standard output before the program terminates.
Putting an infinite loop in main doesnt help. Anybody has an idea.

You need to create a TApplication object (or TRint if you want to use the CINT command line from your program). TApplication creates an application environment, which provides the interface to the graphics system and event loop. The event loop starts by calling its Run() method. Please see examples provided in $ROOTSYS/test directory.
Cheers, Ilka

Thanks a lot. That solved the problem