如何在Ubuntu中安装Gnome开发环境?
请打开终端,输入以下命令:
$ sudo apt-get install gnome-common gnome-devel gnome-core-devel
片刻之后,即安装完毕。
下面写一个Gnome程序验证下,以gnhello.c为例[1]:
#include <gnome.h>
#define VERSION "1.10.12"
int main(int argc, char *argv[])
{
GtkWidget *app; /* pointer to our main window */
/* initialize gnome */
gnome_init("hello world", VERSION, argc, argv);
/* create main window */
app = gnome_app_new("hello_world", "Hello World (Gnome Edition)");
/* connect "delete_event" (happens when the window is closed */
gtk_signal_connect(GTK_OBJECT(app), "destroy",
GTK_SIGNAL_FUNC(gtk_main_quit), NULL);
/* show all the widgets on the main window and the window itself */
gtk_widget_show_all(app);
/* run the main loop */
gtk_main();
return 0;
}
编辑完后,保存为gnhello.c。然后在终端中输入以下命令进行编译:
$ gcc -g gnhello.c `pkg-config libgnomeui-2.0 --cflags --libs` -o gnhello
参考资料:
【1】利用GNOME库赖简化应用编程:http://www.ibm.com/developerworks/cn/li ... index.html
如何在Ubuntu中安装Gnome开发环境?
- ubuntu-mm
- 帖子: 55
- 注册时间: 2010-02-28 12:26
- 系统: Ubuntu 18.04
- 来自: 武汉
- 联系:
如何在Ubuntu中安装Gnome开发环境?
Be With Freedom, Be With Ubuntu!
与自由同在,与Ubuntu同行!
欢迎访问默之的博客:http://mutse.github.io
与自由同在,与Ubuntu同行!
欢迎访问默之的博客:http://mutse.github.io