|
程序在编译的时候已经通过.
下面的错误信息是在运行时出现的,该怎么解决?
是用户权限不够吗?
没有添加两个关闭函数的时候,就没有下面的错误
谢谢了!
[root@localhost gtk]# ./gnomewin
GnomeUI-WARNING **: While connecting to session manager:
Authentication Rejected, reason : None of the authentication protocols
specified are supported and host-based authentication failed.
[root@localhost gtk]#
下面是源代码:
/**gnomewin.c**/
#include <gnome.h>
gint eventDelete(GtkWidget *widget,GdkEvent *event,gpointer data);
gint eventDestroy(GtkWidget *widget,GdkEvent *event,gpointer data);
int main(int argc,char *argv[])
{
GtkWidget * topLevelWindow;
gnome_init("gnomewin","1.0",argc,argv);
topLevelWindow=gnome_app_new("gnomewin","Gnome Window");
gtk_signal_connect(GTK_OBJECT(topLevelWindow),"delete_event",GTK_SIGNAL_FUNC(e
ventDelete),NULL);
gtk_signal_connect(GTK_OBJECT(topLevelWindow),"destroy",GTK_SIGNAL_FUNC(eventD
estroy),NULL);
gtk_widget_show(topLevelWindow);
gtk_main();
exit(0);
}
gint eventDelete(GtkWidget *widget,GdkEvent *event,gpointer data){
return(FALSE);
}
gint eventDestroy(GtkWidget *widget,GdkEvent *event,gpointer data){
gtk_main_quit();
return(0);
}
下面是所用的makefile:
CC=gcc
LDLIBS=`gnome-config --libs gnomeui`
CFLAGS=-Wall -g `gnome-config --cflags gnomeui`
gnomewin:gnomewin.o
$(CC) $(LDLIBS) gnomewin.o -o gnomewin
gnomewin.o:gnomewin.c
$(CC) $(CFLAGS) -c gnomewin.c
clean:
rm -f gnomewin.o
rm -f gnomewin |
|