【发布时间】:2012-08-16 00:20:10
【问题描述】:
在使用 Mingw-w64 for Win32 交叉编译 GLib 2.32.4 时,我遇到了以下错误:
gcontenttype.c: In function 'g_content_type_guess':
gcontenttype.c:335:3: error: 'XDG_MIME_TYPE_UNKNOWN' undeclared (first use in this function)
gcontenttype.c:335:3: note: each undeclared identifier is reported only once for each function it appears in
我只能假设以下两件事之一:
我缺少某种预处理器定义或
./configure标志(目前我只将--host和--prefix传递给./configure)。源代码有错误。
进一步挖掘发现XDG_MIME_TYPE_UNKNOWN 被定义为gio/xdgmime/xdgmime.h,如下所示:
extern const char xdg_mime_type_unknown[];
#define XDG_MIME_TYPE_UNKNOWN xdg_mime_type_unknown
但是,gcontenttype.c 中的任何位置似乎都没有包含此文件。
这是我编译库的方式的问题还是库的错误?
【问题讨论】:
标签: cross-compiling glib undeclared-identifier