I have two quwstions first how does a program process events when the XtAppMainLoop is used and secondly why do I get a segmentation violation when ever I tryto run it. The following is a list of arguements that I have used with the gcc to try and get the program to run with XtAppMainLoop, the program runs fine without XtAppMainLoop gcc -o test test3.c -lX11 -lXext -lfl -lXss -lXxf86misc -lXxf86vm -lXxf86dga -lXdpms -lXau -lXdmcp -lXmu -loldX -lXp -lXt -lXaw -lXi -lXtst -lPEX5 -lXIE -lICE -lSM -lXpm -lxkbfile -lm If this command appears on more than one line it shouldn't I know that there is nothing wrong with my libraries because xeyes compiles fine on my system, I got the list of arguements from it's Makefile. Thank you