1、安装 #必要的编程软件包,如gcc、g++、gdb、make 等 sudo apt-get install build-essential #GTK 2.0、3.0开发所需的库 sudo apt-get install libgtk2.0-dev sudo apt-get install libgtk-3-dev #GTK2.0、GTK3.0开发所需的文档 sudo apt-get install libgtk2.0-doc sudo apt-get install libgtk-3-doc #GTK 文档查看程序 sudo apt-get install devhelp #管理库的编译和链接标志的工具 sudo apt-get install pkg-config #GNOME桌面环境 - 开发组件 sudo apt-get install gnome-core-devel #Glade 界面设计器 (glade) sudo apt-get install libglade2-dev
2、测试 运行: pkg-config –cflags –libs gtk+-2.0 现象: -pthread -I/usr/local/include/gio-unix-2.0/ -I/usr/local/include/atk-1.0 -I/usr/local/include/glib-2.0 -I/usr/local/lib/glib-2.0/include -I/usr/include/gtk-2.0 -I/usr/include/pango-1.0 -I/usr/include/cairo -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/freetype2 -I/usr/include/pixman-1 -I/usr/include/libpng12 说明成功
3、linux编译程序 gcc demo.c -o demo pkg-config --cflags --libs gtk+-2.0 gmodule-export-2.0
新闻热点
疑难解答