首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >gtk+-2.0中的maemo scratchbox编译器错误

gtk+-2.0中的maemo scratchbox编译器错误
EN

Stack Overflow用户
提问于 2009-07-13 04:13:25
回答 1查看 686关注 0票数 2

我正在尝试遵循3.4.2节,从this manual的第31页开始。但是,由于我已将目标配置为DIABLO_ARMEL而不是DIABLO_X86,因此此命令得到了不同的结果:

代码语言:javascript
复制
[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: ~] >

在输入此行之前,我已经检查了用单引号引起来的命令的cflag和libs结果,以及示例中描述的结果和我在命令窗口中看到的结果之间的关系。

无论如何,我不希望在终端中弹出错误消息,但我得到了以下信息:

代码语言:javascript
复制
[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'

我不确定我在include和库路径配置方面做错了什么。如果有人能提供一些修复这个错误的提示,那就太好了。提前谢谢。

EN

回答 1

Stack Overflow用户

发布于 2009-07-15 20:10:37

pkg-config前后需要使用反引号:

代码语言:javascript
复制
gcc -Wall -g gtk-helloworld-1.c `pkg-config --cflags gtk+-2.0`... -o gtk ...
票数 4
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/1117673

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档