当前位置: 技术问答>linux和unix
有个问题请教!(关于Gnome的一个疑问)
来源: 互联网 发布时间:2015-07-29
本文导语: 我是一个初学者,在RED HAT9.0 下面有这个程序: #include int main( int argc, char *argv[] ) { GtkWidget *window; gtk_init (&argc, &argv); window = gtk_window_new (GTK_WINDOW_TOPLEVEL); gtk_w...
我是一个初学者,在RED HAT9.0 下面有这个程序:
#include
int main( int argc, char *argv[] )
{
GtkWidget *window;
gtk_init (&argc, &argv);
window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
gtk_widget_show (window);
gtk_main ();
return (0) ;
}
在编译的时候出现错误,说gnome.h文件无法找到,我把上面的程序的第1行改为#include 找到了这个文件。也还是出现错误(显示如下)。我想问一下怎样解决这个问题。先在这里谢谢了。
In file included from mian.c:1:
/usr/include/gnome-1.0/gnome.h:12:26: gnomesupport.h: No such file or directory
/usr/include/gnome-1.0/gnome.h:14:21: gtk/gtk.h: No such file or directory
In file included from /usr/include/gdk_imlib.h:5,
from /usr/include/gnome-1.0/gnome.h:15,
from mian.c:1:
/usr/include/gdk_imlib_types.h:1:21: gdk/gdk.h: No such file or directory
In file included from /usr/include/gdk_imlib.h:5,
from /usr/include/gnome-1.0/gnome.h:15,
from mian.c:1:
/usr/include/gdk_imlib_types.h:17: parse error before "gint"
/usr/include/gdk_imlib_types.h:19: parse error before '}' token
/usr/include/gdk_imlib_types.h:23: parse error before "gint"
/usr/include/gdk_imlib_types.h:29: parse error before "gint"
/usr/include/gdk_imlib_types.h:31: parse error before "contrast"
/usr/include/gdk_imlib_types.h:41: parse error before "gint"
/usr/include/gdk_imlib_types.h:44: parse error before '*' token
/usr/include/gdk_imlib_types.h:46: parse error before "width"
/usr/include/gdk_imlib_types.h:49: parse error before '*' token
/usr/include/gdk_imlib_types.h:50: parse error before '*' token
/usr/include/gdk_imlib_types.h:51: parse error before "cache"
/usr/include/gdk_imlib_types.h:55: parse error before '*' token
/usr/include/gdk_imlib_types.h:56: parse error before '}' token
In file included from /usr/include/gnome-1.0/gnome.h:15,
from mian.c:1:
/usr/include/gdk_imlib.h:14: parse error before "gdk_imlib_get_render_type"
/usr/include/gdk_imlib.h:15: parse error before "rend_type"
/usr/include/gdk_imlib.h:16: parse error before "gdk_imlib_load_colors"
/usr/include/gdk_imlib.h:19: parse error before "gdk_imlib_best_color_match"
/usr/include/gdk_imlib.h:19: parse error before '*' token
/usr/include/gdk_imlib.h:20: parse error before '*' token
/usr/include/gdk_imlib.h:21: parse error before "gdk_imlib_render"
/usr/include/gdk_imlib.h:21: parse error before "gint"
/usr/include/gdk_imlib.h:22: parse error before '*' token
/usr/include/gdk_imlib.h:23: parse error before '*' token
/usr/include/gdk_imlib.h:24: parse error before '*' token
/usr/include/gdk_imlib.h:25: parse error before '*' token
/usr/include/gdk_imlib.h:29: parse error before '*' token
/usr/include/gdk_imlib.h:30: parse error before '*' token
/usr/include/gdk_imlib.h:35: parse error before "gdk_imlib_save_image_to_eim"
/usr/include/gdk_imlib.h:36: parse error before "gdk_imlib_add_image_to_eim"
/usr/include/gdk_imlib.h:37: parse error before "gdk_imlib_save_image_to_ppm"
/usr/include/gdk_imlib.h:38: parse error before "gdk_imlib_load_file_to_pixmap"
/usr/include/gdk_imlib.h:38: parse error before "GdkPixmap"
/usr/include/gdk_imlib.h:55: parse error before "GdkWindow"
/usr/include/gdk_imlib.h:56: parse error before "GdkWindow"
/usr/include/gdk_imlib.h:57: parse error before "GdkWindow"
/usr/include/gdk_imlib.h:60: parse error before "gint"
/usr/include/gdk_imlib.h:61: parse error before "gint"
/usr/include/gdk_imlib.h:64: parse error before "gdk_imlib_get_fallback"
/usr/include/gdk_imlib.h:65: parse error before "fallback"
/usr/include/gdk_imlib.h:66: parse error before '*' token
/usr/include/gdk_imlib.h:67: parse error before '*' token
/usr/include/gdk_imlib.h:68: parse error before '*' token
/usr/include/gdk_imlib.h:70: parse error before "gdk_imlib_data_to_pixmap"
/usr/include/gdk_imlib.h:70: parse error before "GdkPixmap"
/usr/include/gdk_imlib.h:71: parse error before "gint"
/usr/include/gdk_imlib.h:72: parse error before "gdk_imlib_save_image"
/usr/include/gdk_imlib.h:74: parse error before '*' token
In file included from /usr/include/gnome-1.0/gnome.h:16,
from mian.c:1:
/usr/include/gnome-1.0/libgnome/libgnome.h:23:33: libgnome/gnome-defs.h: No such file or directory
/usr/include/gnome-1.0/libgnome/libgnome.h:24:35: libgnome/gnome-config.h: No such file or directory
/usr/include/gnome-1.0/libgnome/libgnome.h:25:35: libgnome/gnome-dentry.h: No such file or directory
/usr/include/gnome-1.0/libgnome/libgnome.h:26:33: libgnome/gnome-exec.h: No such file or directory
/usr/include/gnome-1.0/libgnome/libgnome.h:27:33: libgnome/gnome-help.h: No such file or directory
/usr/include/gnome-1.0/libgnome/libgnome.h:28:33: libgnome/gnome-i18n.h: No such file or directory
/usr/include/gnome-1.0/libgnome/libgnome.h:29:37: libgnome/gnome-metadata.h: No
such file or directory
/usr/include/gnome-1.0/libgnome/libgnome.h:30:33: libgnome/gnome-mime.h: No such file or directory
/usr/include/gnome-1.0/libgnome/libgnome.h:31:38: libgnome/gnome-mime-info.h: No such file or directory
/usr/include/gnome-1.0/libgnome/libgnome.h:33:34: libgnome/gnome-paper.h: No such file or directory
/usr/include/gnome-1.0/libgnome/libgnome.h:34:33: libgnome/gnome-popt.h: No such file or directory
/usr/include/gnome-1.0/libgnome/libgnome.h:35:35: libgnome/gnome-remote.h: No such file or directory
/usr/include/gnome-1.0/libgnome/libgnome.h:36:34: libgnome/gnome-score.h: No such file or directory
/usr/include/gnome-1.0/libgnome/libgnome.h:37:34: libgnome/gnome-sound.h: No such file or directory
/usr/include/gnome-1.0/libgnome/libgnome.h:38:37: libgnome/gnome-triggers.h: No
such file or directory
/usr/include/gnome-1.0/libgnome/libgnome.h:39:33: libgnome/gnome-util.h: No such file or directory
/usr/include/gnome-1.0/libgnome/libgnome.h:40:32: libgnome/gnome-url.h: No such
file or directory
In file included from /usr/include/gnome-1.0/gnome.h:16,
from mian.c:1:
/usr/include/gnome-1.0/libgnome/libgnome.h:51: syntax error before "void"
In file included from /usr/include/gnome-1.0/gnome.h:17,
from mian.c:1:
/usr/include/gnome-1.0/libgnomeui/libgnomeui.h:4:37: libgnomeui/gnome-compat.h:
No such file or directory
......
mian.c:2: syntax error before "int"
mian.c: In function `main':
mian.c:4: `GtkWidget' undeclared (first use in this function)
mian.c:4: (Each undeclared identifier is reported only once
mian.c:4: for each function it appears in.)
mian.c:4: `window' undeclared (first use in this function)
mian.c:6: `GTK_WINDOW_TOPLEVEL' undeclared (first use in this function)
mian.c: At top level:
/usr/include/gdk_imlib_types.h:47: storage size of `shape_color' isn't known
/usr/include/gdk_imlib_types.h:48: storage size of `border' isn't known
/usr/include/gdk_imlib_types.h:52: storage size of `mod' isn't known
/usr/include/gdk_imlib_types.h:52: storage size of `rmod' isn't known
/usr/include/gdk_imlib_types.h:52: storage size of `gmod' isn't known
/usr/include/gdk_imlib_types.h:52: storage size of `bmod' isn't known
#include
int main( int argc, char *argv[] )
{
GtkWidget *window;
gtk_init (&argc, &argv);
window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
gtk_widget_show (window);
gtk_main ();
return (0) ;
}
在编译的时候出现错误,说gnome.h文件无法找到,我把上面的程序的第1行改为#include 找到了这个文件。也还是出现错误(显示如下)。我想问一下怎样解决这个问题。先在这里谢谢了。
In file included from mian.c:1:
/usr/include/gnome-1.0/gnome.h:12:26: gnomesupport.h: No such file or directory
/usr/include/gnome-1.0/gnome.h:14:21: gtk/gtk.h: No such file or directory
In file included from /usr/include/gdk_imlib.h:5,
from /usr/include/gnome-1.0/gnome.h:15,
from mian.c:1:
/usr/include/gdk_imlib_types.h:1:21: gdk/gdk.h: No such file or directory
In file included from /usr/include/gdk_imlib.h:5,
from /usr/include/gnome-1.0/gnome.h:15,
from mian.c:1:
/usr/include/gdk_imlib_types.h:17: parse error before "gint"
/usr/include/gdk_imlib_types.h:19: parse error before '}' token
/usr/include/gdk_imlib_types.h:23: parse error before "gint"
/usr/include/gdk_imlib_types.h:29: parse error before "gint"
/usr/include/gdk_imlib_types.h:31: parse error before "contrast"
/usr/include/gdk_imlib_types.h:41: parse error before "gint"
/usr/include/gdk_imlib_types.h:44: parse error before '*' token
/usr/include/gdk_imlib_types.h:46: parse error before "width"
/usr/include/gdk_imlib_types.h:49: parse error before '*' token
/usr/include/gdk_imlib_types.h:50: parse error before '*' token
/usr/include/gdk_imlib_types.h:51: parse error before "cache"
/usr/include/gdk_imlib_types.h:55: parse error before '*' token
/usr/include/gdk_imlib_types.h:56: parse error before '}' token
In file included from /usr/include/gnome-1.0/gnome.h:15,
from mian.c:1:
/usr/include/gdk_imlib.h:14: parse error before "gdk_imlib_get_render_type"
/usr/include/gdk_imlib.h:15: parse error before "rend_type"
/usr/include/gdk_imlib.h:16: parse error before "gdk_imlib_load_colors"
/usr/include/gdk_imlib.h:19: parse error before "gdk_imlib_best_color_match"
/usr/include/gdk_imlib.h:19: parse error before '*' token
/usr/include/gdk_imlib.h:20: parse error before '*' token
/usr/include/gdk_imlib.h:21: parse error before "gdk_imlib_render"
/usr/include/gdk_imlib.h:21: parse error before "gint"
/usr/include/gdk_imlib.h:22: parse error before '*' token
/usr/include/gdk_imlib.h:23: parse error before '*' token
/usr/include/gdk_imlib.h:24: parse error before '*' token
/usr/include/gdk_imlib.h:25: parse error before '*' token
/usr/include/gdk_imlib.h:29: parse error before '*' token
/usr/include/gdk_imlib.h:30: parse error before '*' token
/usr/include/gdk_imlib.h:35: parse error before "gdk_imlib_save_image_to_eim"
/usr/include/gdk_imlib.h:36: parse error before "gdk_imlib_add_image_to_eim"
/usr/include/gdk_imlib.h:37: parse error before "gdk_imlib_save_image_to_ppm"
/usr/include/gdk_imlib.h:38: parse error before "gdk_imlib_load_file_to_pixmap"
/usr/include/gdk_imlib.h:38: parse error before "GdkPixmap"
/usr/include/gdk_imlib.h:55: parse error before "GdkWindow"
/usr/include/gdk_imlib.h:56: parse error before "GdkWindow"
/usr/include/gdk_imlib.h:57: parse error before "GdkWindow"
/usr/include/gdk_imlib.h:60: parse error before "gint"
/usr/include/gdk_imlib.h:61: parse error before "gint"
/usr/include/gdk_imlib.h:64: parse error before "gdk_imlib_get_fallback"
/usr/include/gdk_imlib.h:65: parse error before "fallback"
/usr/include/gdk_imlib.h:66: parse error before '*' token
/usr/include/gdk_imlib.h:67: parse error before '*' token
/usr/include/gdk_imlib.h:68: parse error before '*' token
/usr/include/gdk_imlib.h:70: parse error before "gdk_imlib_data_to_pixmap"
/usr/include/gdk_imlib.h:70: parse error before "GdkPixmap"
/usr/include/gdk_imlib.h:71: parse error before "gint"
/usr/include/gdk_imlib.h:72: parse error before "gdk_imlib_save_image"
/usr/include/gdk_imlib.h:74: parse error before '*' token
In file included from /usr/include/gnome-1.0/gnome.h:16,
from mian.c:1:
/usr/include/gnome-1.0/libgnome/libgnome.h:23:33: libgnome/gnome-defs.h: No such file or directory
/usr/include/gnome-1.0/libgnome/libgnome.h:24:35: libgnome/gnome-config.h: No such file or directory
/usr/include/gnome-1.0/libgnome/libgnome.h:25:35: libgnome/gnome-dentry.h: No such file or directory
/usr/include/gnome-1.0/libgnome/libgnome.h:26:33: libgnome/gnome-exec.h: No such file or directory
/usr/include/gnome-1.0/libgnome/libgnome.h:27:33: libgnome/gnome-help.h: No such file or directory
/usr/include/gnome-1.0/libgnome/libgnome.h:28:33: libgnome/gnome-i18n.h: No such file or directory
/usr/include/gnome-1.0/libgnome/libgnome.h:29:37: libgnome/gnome-metadata.h: No
such file or directory
/usr/include/gnome-1.0/libgnome/libgnome.h:30:33: libgnome/gnome-mime.h: No such file or directory
/usr/include/gnome-1.0/libgnome/libgnome.h:31:38: libgnome/gnome-mime-info.h: No such file or directory
/usr/include/gnome-1.0/libgnome/libgnome.h:33:34: libgnome/gnome-paper.h: No such file or directory
/usr/include/gnome-1.0/libgnome/libgnome.h:34:33: libgnome/gnome-popt.h: No such file or directory
/usr/include/gnome-1.0/libgnome/libgnome.h:35:35: libgnome/gnome-remote.h: No such file or directory
/usr/include/gnome-1.0/libgnome/libgnome.h:36:34: libgnome/gnome-score.h: No such file or directory
/usr/include/gnome-1.0/libgnome/libgnome.h:37:34: libgnome/gnome-sound.h: No such file or directory
/usr/include/gnome-1.0/libgnome/libgnome.h:38:37: libgnome/gnome-triggers.h: No
such file or directory
/usr/include/gnome-1.0/libgnome/libgnome.h:39:33: libgnome/gnome-util.h: No such file or directory
/usr/include/gnome-1.0/libgnome/libgnome.h:40:32: libgnome/gnome-url.h: No such
file or directory
In file included from /usr/include/gnome-1.0/gnome.h:16,
from mian.c:1:
/usr/include/gnome-1.0/libgnome/libgnome.h:51: syntax error before "void"
In file included from /usr/include/gnome-1.0/gnome.h:17,
from mian.c:1:
/usr/include/gnome-1.0/libgnomeui/libgnomeui.h:4:37: libgnomeui/gnome-compat.h:
No such file or directory
......
mian.c:2: syntax error before "int"
mian.c: In function `main':
mian.c:4: `GtkWidget' undeclared (first use in this function)
mian.c:4: (Each undeclared identifier is reported only once
mian.c:4: for each function it appears in.)
mian.c:4: `window' undeclared (first use in this function)
mian.c:6: `GTK_WINDOW_TOPLEVEL' undeclared (first use in this function)
mian.c: At top level:
/usr/include/gdk_imlib_types.h:47: storage size of `shape_color' isn't known
/usr/include/gdk_imlib_types.h:48: storage size of `border' isn't known
/usr/include/gdk_imlib_types.h:52: storage size of `mod' isn't known
/usr/include/gdk_imlib_types.h:52: storage size of `rmod' isn't known
/usr/include/gdk_imlib_types.h:52: storage size of `gmod' isn't known
/usr/include/gdk_imlib_types.h:52: storage size of `bmod' isn't known
|
把你的编译语句贴出来看看!
用这个试试!
gcc -Wall `gtk-config --cflags --libs` filename.c -g -o filename -lgtk -lgdk -lpthread
``是键盘左上角的1旁边的键!
用这个试试!
gcc -Wall `gtk-config --cflags --libs` filename.c -g -o filename -lgtk -lgdk -lpthread
``是键盘左上角的1旁边的键!
|
可能需要自己添加 -I 和 -L 路径吧。。。
|
:)