|
我在用gtk/gnome做界面,包含一个文档界面(有工具栏)和一个弹出式对话框(包括两个radio按钮和3个entrybutton),两者分开时编译运行都正常。但当把对话框放入文档中,即和菜单和工具栏做连接时,编译通过,但是执行却出问题了。是在对话框弹出后,点击“ok”或“cancel”都会出现错误对话框,如下显示:Application "./frame" (process 2889) has crashed due to a fatal error.(Segmentation fault)
但是点击“关闭”,却是好的。(“关闭”和“cancel”的程序代码是一样的)
代码是:
Angle *angle;
angle = (Angle *)user_data;
gtk_widget_destroy(GTK_WIDGET(angle->dialog);
Angle是我建的一个struct。
我用gdb来查错,输出结果是:
Breakpoint 1, main (argc=1, argv=0xbffff9f4) at frame.c:14
14 gnome_init("frame","1.0",argc,argv);
(gdb) s
0x4009eab4 in gnome_init () at eval.c:41
41 eval.c: No such file or directory.
in eval.c
(gdb) n
GnomeUI-WARNING **: Could not open help topics file NULL
Program received signal SIGSEGV, Segmentation fault.
0x40245331 in gtk_type_check_object_cast () at eval.c:41
41 in eval.c
(gdb) n
0x4050566a in __wait4 () from /lib/i686/libc.so.6
(gdb) n
Single stepping until exit from function __wait4,
which has no line number information.
__libc_waitpid (pid=2993, stat_loc=0xbfffe9a0, options=0) at ../sysdeps/unix/sysv/linux/waitpid.c:27
27 ../sysdeps/unix/sysv/linux/waitpid.c: No such file or directory.
in ../sysdeps/unix/sysv/linux/waitpid.c
(gdb) n
26 in ../sysdeps/unix/sysv/linux/waitpid.c
(gdb) n
27 in ../sysdeps/unix/sysv/linux/waitpid.c
(gdb) n
0x4009ee88 in gnome_segv_handle () at eval.c:41
41 eval.c: No such file or directory.
in eval.c
(gdb) n
Program exited with code 01.
实在是搞不懂到底是哪里错了,请各位大虾指教阿! |
|