gtk+-2.0 的 maemo scrapbox 编译器错误
我正在尝试遵循第 3.4.2 节,从 第 31 页开始本手册。 但是,由于我已将目标配置为 DIABLO_ARMEL 而不是 DIABLO_X86,因此该命令得到了不同的结果:
[sbox-DIABLO_X86: ~] > gcc -Wall -g gtk_helloworld-1.c \
‘pkg-config --cflags gtk+-2.0‘ -o gtk_helloworld-1 \
‘pkg-config --libs gtk+-2.0‘
[sbox-DIABLO_X86: ~] >
在输入此行之前,我已检查单引号中的命令的 cflags 和 libs 结果,以及所描述内容之间的结果在示例中以及我在命令窗口中看到的内容。
无论如何,我预计不会在终端中弹出错误消息,但我得到以下信息:
[sbox-DIABLO_ARMEL: ~] > gcc -Wall -g gtk-helloworld-1.c \
> 'pkg-config --cflags gtk+-2.0' -o gtk_helloworld-1 \
> 'pkg-config --libs gtk+-2.0'
sbox-arm-linux-gcc: pkg-config --cflags gtk+-2.0: No such file or directory
sbox-arm-linux-gcc: pkg-config --libs gtk+-2.0: No such file or directory
gtk-helloworld-1.c:15:21: gtk/gtk.h: No such file or directory
gtk-helloworld-1.c: In function `main':
gtk-helloworld-1.c:20: error: `GtkWindow' undeclared (first use in this function)
gtk-helloworld-1.c:20: error: (Each undeclared identifier is reported only once
gtk-helloworld-1.c:20: error: for each function it appears in.)
gtk-helloworld-1.c:20: error: `window' undeclared (first use in this function)
gtk-helloworld-1.c:21: error: `GtkLabel' undeclared (first use in this function)
gtk-helloworld-1.c:21: error: `label' undeclared (first use in this function)
gtk-helloworld-1.c:24: warning: implicit declaration of function `gtk_init'
gtk-helloworld-1.c:28: warning: implicit declaration of function `g_object_new'
gtk-helloworld-1.c:28: error: `GTK_TYPE_WINDOW' undeclared (first use in this function)
gtk-helloworld-1.c:34: error: `GTK_TYPE_LABEL' undeclared (first use in this function)
gtk-helloworld-1.c:39: warning: implicit declaration of function `gtk_container_add'
gtk-helloworld-1.c:39: warning: implicit declaration of function `GTK_CONTAINER'
gtk-helloworld-1.c:39: warning: implicit declaration of function `GTK_WIDGET'
gtk-helloworld-1.c:42: warning: implicit declaration of function `gtk_widget_show_all'
gtk-helloworld-1.c:45: warning: implicit declaration of function `g_print'
gtk-helloworld-1.c:46: warning: implicit declaration of function `gtk_main'
我不确定在包含和库路径配置方面我做错了什么。 如果有人可以提供一些修复此错误的提示,那就太好了。 提前致谢。
I'm trying to follow section 3.4.2, starting on page 31 of this manual. However, as I have configured my target to be DIABLO_ARMEL rather than DIABLO_X86, I have gotten different results for this command:
[sbox-DIABLO_X86: ~] > gcc -Wall -g gtk_helloworld-1.c \
‘pkg-config --cflags gtk+-2.0‘ -o gtk_helloworld-1 \
‘pkg-config --libs gtk+-2.0‘
[sbox-DIABLO_X86: ~] >
I have checked the cflags and libs results of the commands in single quotes before entering this line, and the results between what were described in the example and what I saw in the command window.
Anyhow, I'm not expected to have error messages popping up in the terminal, but I got the following:
[sbox-DIABLO_ARMEL: ~] > gcc -Wall -g gtk-helloworld-1.c \
> 'pkg-config --cflags gtk+-2.0' -o gtk_helloworld-1 \
> 'pkg-config --libs gtk+-2.0'
sbox-arm-linux-gcc: pkg-config --cflags gtk+-2.0: No such file or directory
sbox-arm-linux-gcc: pkg-config --libs gtk+-2.0: No such file or directory
gtk-helloworld-1.c:15:21: gtk/gtk.h: No such file or directory
gtk-helloworld-1.c: In function `main':
gtk-helloworld-1.c:20: error: `GtkWindow' undeclared (first use in this function)
gtk-helloworld-1.c:20: error: (Each undeclared identifier is reported only once
gtk-helloworld-1.c:20: error: for each function it appears in.)
gtk-helloworld-1.c:20: error: `window' undeclared (first use in this function)
gtk-helloworld-1.c:21: error: `GtkLabel' undeclared (first use in this function)
gtk-helloworld-1.c:21: error: `label' undeclared (first use in this function)
gtk-helloworld-1.c:24: warning: implicit declaration of function `gtk_init'
gtk-helloworld-1.c:28: warning: implicit declaration of function `g_object_new'
gtk-helloworld-1.c:28: error: `GTK_TYPE_WINDOW' undeclared (first use in this function)
gtk-helloworld-1.c:34: error: `GTK_TYPE_LABEL' undeclared (first use in this function)
gtk-helloworld-1.c:39: warning: implicit declaration of function `gtk_container_add'
gtk-helloworld-1.c:39: warning: implicit declaration of function `GTK_CONTAINER'
gtk-helloworld-1.c:39: warning: implicit declaration of function `GTK_WIDGET'
gtk-helloworld-1.c:42: warning: implicit declaration of function `gtk_widget_show_all'
gtk-helloworld-1.c:45: warning: implicit declaration of function `g_print'
gtk-helloworld-1.c:46: warning: implicit declaration of function `gtk_main'
I'm not sure what I'm doing wrong in terms of the include and library path configurations. It would be great if someone can provide some tips on fixing this error. Thanks in advance.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您需要在 pkg-config 周围加反引号:
You need back-quotes around pkg-config: