There's a command line option to prevent the console window from showing. Don't know which gcc you're using (what invokes it, if other than you), so can't comment further.