在C语言中使用gtk编写GUI程序时如何摆脱控制台? [英] How do I get rid of the console when writing GUI programs with gtk in C?

查看:436
本文介绍了在C语言中使用gtk编写GUI程序时如何摆脱控制台?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我按照教程:

http://zetcode.com/tutorials/gtktutorial/firstprograms/

它可以工作,但每次我双击可执行文件,有一个

It works but each time I double click on the executable,there is a console which I don't want it there.

如何摆脱该控制台?

:windows XP。

Platform: windows XP.

BTW我也有这个麻烦,当右击图标:

BTW I also have this trouble when right click on the icon:

GLib-WARNING **: g_main_context_check() called recursively from within a source's check() or prepare() member.

有没有人熟悉这个?

推荐答案

链接时,使用参数-mwindows

When you link, use the argument -mwindows

gcc -o simple simple.c `pkg-config --libs --cflags gtk+-2.0` -mwindows

这篇关于在C语言中使用gtk编写GUI程序时如何摆脱控制台?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆