Ubuntu+Eclipse下开发GTK+应用程序

1、安装相关依赖的包

2、如何方便的输入GTK+的include、lib依赖

3、在Eclipse中配置
(1)右键项目->Properties->C/C++ Build->Settings->GCC C Compiler->Miscellaneous,加入pkg-config --cflags --libs gtk+-2.0
(2)右键项目->Properties->C/C++ Build->Settings->GCC C Linker>Miscellaneous,加入pkg-config --cflags --libs gtk+-2.0
(3)右键项目->Properties->C/C++ Build->Settings->GCC C Compiler->Directories,加入/usr/include/gtk-2.0 和 /usr/include/glib-2.0 这个是为了方便智能提示。

4、测试程序

最后,一个很好的GTK+教程:
http://zetcode.com/tutorials/gtktutorial/chinese/

Leave a Reply

Your email address will not be published.