My college uses a linux os, we can start xserver and then empty gui will appear, i wrote program to display a line, i compiled the code it 's fine. but when i execute the program it shows segmentation fault, how to execute the program in gui??
If your program segfaults, it probably has nothing to do with the GUI. You are probably attempting to access memory you weren't granted.
For your question on how to program a GUI, my best suggestion would be to use a library like Qt or GTK to abstract away the hard, strange Xserver code.
精彩评论