#include <gnome.h>
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 <gnome-1.0/gnome.h>找到了这个文件。也还是出现错误(显示如下)。我想问一下怎样解决这个问题。先在这里谢谢了。
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
11 个解决方案
#1
up
#2
可能需要自己添加 -I 和 -L 路径吧。。。
#3
这个提示是说:
/usr/include/gnome-1.0/gnome.h:12:26: gnomesupport.h: No such file or directory
以这个提示为例子:gnomesupport.h找不到,但是我的gnome库是默认设置安装的,怎么可能找不到gnome.h里面所包含的gnomesupport.h呢?
我没改过gnome.h这个文件。
/usr/include/gnome-1.0/gnome.h:12:26: gnomesupport.h: No such file or directory
以这个提示为例子:gnomesupport.h找不到,但是我的gnome库是默认设置安装的,怎么可能找不到gnome.h里面所包含的gnomesupport.h呢?
我没改过gnome.h这个文件。
#4
up
#5
没人帮帮小弟我吗?各位大哥大姐救命啊!!!!
#6
:)
#7
做过GNOME开发GUI的哥哥姐姐们,告诉我你们的环境是怎么设置的就可以了啊,没人救命吗?????
#8
把你的编译语句贴出来看看!
用这个试试!
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旁边的键!
#9
还是搞不定啊,大哥。
#10
出的错误提示和我上面的是一样的哦 编译语句不用那么复杂啊,我的就是
#11
gcc -o filename filename.c
#1
up
#2
可能需要自己添加 -I 和 -L 路径吧。。。
#3
这个提示是说:
/usr/include/gnome-1.0/gnome.h:12:26: gnomesupport.h: No such file or directory
以这个提示为例子:gnomesupport.h找不到,但是我的gnome库是默认设置安装的,怎么可能找不到gnome.h里面所包含的gnomesupport.h呢?
我没改过gnome.h这个文件。
/usr/include/gnome-1.0/gnome.h:12:26: gnomesupport.h: No such file or directory
以这个提示为例子:gnomesupport.h找不到,但是我的gnome库是默认设置安装的,怎么可能找不到gnome.h里面所包含的gnomesupport.h呢?
我没改过gnome.h这个文件。
#4
up
#5
没人帮帮小弟我吗?各位大哥大姐救命啊!!!!
#6
:)
#7
做过GNOME开发GUI的哥哥姐姐们,告诉我你们的环境是怎么设置的就可以了啊,没人救命吗?????
#8
把你的编译语句贴出来看看!
用这个试试!
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旁边的键!
#9
还是搞不定啊,大哥。
#10
出的错误提示和我上面的是一样的哦 编译语句不用那么复杂啊,我的就是
#11
gcc -o filename filename.c