If you only want to compile some C files, you should try "gcc". When you use KDevelop, it's an complete (IDE), so, maybe it's too much for your work. With gcc, you will compile only. In the command line type "gcc -o execfile sourcefile.c".

This will compile the "sourcefile.c" to "execfile". I'm not sure if this will work with your cgi, but you should try to investigate if this options works for you.