LinuxSir.cn,穿越时空的Linuxsir!

 找回密码
 注册
搜索
热搜: shell linux mysql
查看: 1658|回复: 1

gcc -Wall -g helloworld.c -o helloworld `pkg-config --cflags gtk+-2.0` \ `pkg

[复制链接]
发表于 2004-2-7 16:45:47 | 显示全部楼层 |阅读模式
hello示例程序编译出问题:
gcc -Wall -g helloworld.c -o helloworld `pkg-config --cflags gtk+-2.0` \
`pkg-config --libs gtk+-2.0`

gcc: pkg-config --cflags gtk+-2.0pkg-config --libs gtk+-2.0: 没有那个文件或目录
hello.c:1:21: gtk/gtk.h: 没有那个文件或目录
hello.c:5: error: syntax error before '*' token
hello.c: In function `hello':
hello.c:8: warning: implicit declaration of function `g_print'
hello.c: At top level:
hello.c:11: error: syntax error before "delete_event"
hello.c:11: error: syntax error before '*' token
hello.c:14: warning: return type defaults to `int'
hello.c: In function `delete_event':
hello.c:23: error: `TRUE' undeclared (first use in this function)
hello.c:23: error: (Each undeclared identifier is reported only once
hello.c:23: error: for each function it appears in.)
hello.c: At top level:
hello.c:27: error: syntax error before '*' token
hello.c: In function `destroy':
hello.c:30: warning: implicit declaration of function `gtk_main_quit'
hello.c: In function `main':
hello.c:37: error: `GtkWidget' undeclared (first use in this function)
hello.c:37: error: `window' undeclared (first use in this function)
hello.c:38: error: `button' undeclared (first use in this function)
hello.c:41: warning: implicit declaration of function `gtk_init'
hello.c:44: warning: implicit declaration of function `gtk_window_new'
hello.c:44: error: `GTK_WINDOW_TOPLEVEL' undeclared (first use in this function)
而pkg-config --cflags gtk+-2.0
和pkg-config --libs gtk+-2.0又能找到include等。
发表于 2004-2-7 18:36:28 | 显示全部楼层
不太清楚是什么问题,可能是有些包没有装,比如libgtk2.0-dev,你到
/usr/include/gtk-2.0/gtk/ 下看看有没有gtk.h
还有,/usr/lib/pkgconfig/下看看有没有gtk-2.0.pc文件
您需要登录后才可以回帖 登录 | 注册

本版积分规则

快速回复 返回顶部 返回列表