当前位置: 技术问答>linux和unix
找不到gnome.h文件,一天了也没有解决
来源: 互联网 发布时间:2015-11-13
本文导语: 我装的是 redhat 9.0完全安装 程序: #include gint main(gint argc,gchar *argv[]) { gnome_init("hello","1.0",argc,argv); return 0; } 编译:gcc -o test test.c `gnome-config --cflags --libs gnomeui` ...
我装的是 redhat 9.0完全安装
程序:
#include
gint main(gint argc,gchar *argv[])
{
gnome_init("hello","1.0",argc,argv);
return 0;
}
编译:gcc -o test test.c `gnome-config --cflags --libs gnomeui`
出错结果
[root@localhost ~]# gcc -o test test.c `gnome-config --cflags --libs gnomeui` bash: gnome-config: command not found
test.c:2:19: /gnome.h: 没有那个文件或目录
test.c:4: error: syntax error before "main"
test.c:4: error: syntax error before "argc"
test.c: In function `main':
test.c:8: error: `argc' undeclared (first use in this function)
test.c:8: error: (Each undeclared identifier is reported only once
test.c:8: error: for each function it appears in.)
test.c:8: error: `argv' undeclared (first use in this function)
上网查资料还是这样,无奈麻烦大家了!!!!
说明: 在 /usr/include/libgnomeui-2.0下有gnome.h文件
程序:
#include
gint main(gint argc,gchar *argv[])
{
gnome_init("hello","1.0",argc,argv);
return 0;
}
编译:gcc -o test test.c `gnome-config --cflags --libs gnomeui`
出错结果
[root@localhost ~]# gcc -o test test.c `gnome-config --cflags --libs gnomeui` bash: gnome-config: command not found
test.c:2:19: /gnome.h: 没有那个文件或目录
test.c:4: error: syntax error before "main"
test.c:4: error: syntax error before "argc"
test.c: In function `main':
test.c:8: error: `argc' undeclared (first use in this function)
test.c:8: error: (Each undeclared identifier is reported only once
test.c:8: error: for each function it appears in.)
test.c:8: error: `argv' undeclared (first use in this function)
上网查资料还是这样,无奈麻烦大家了!!!!
说明: 在 /usr/include/libgnomeui-2.0下有gnome.h文件
|
把`gnome-config --cflags --libs gnomeui`
换成`pkg-config --cflags --libs gnomeui`
换成`pkg-config --cflags --libs gnomeui`
|
gint 是GTK库里面的吧 你要么加上gtk.h
要么改成int
要么改成int
|
编译时用-I把文件路径加上