缺少 locale_t
在 libintl.h 第 440 行中,使用 macports 安装 gtk 1.2(软件包名称 gtk1)会在最终 make 中阻塞。
extern locale_t libintl_newlocale (junk, stuff, stuff)
编译器找不到 locale_t,而且我也没有做得更好。
该文件导入不存在的 locale.h 和未定义此类型的 xlocale.h。
locale_t 应该在哪里定义?这可能就像缺少依赖项一样简单,但我不知道缺少什么。
根据要求,这里是 xlocale.h,减去版权,这是 Open Group 的。
#include <X11/Xfuncproto.h>
#include <X11/Xosdefs.h>
#ifndef X_LOCALE
#include <locale.h>
#else
#define LC_ALL 0
#define LC_COLLATE 1
#define LC_CTYPE 2
#define LC_MONETARY 3
#define LC_NUMERIC 4
#define LC_TIME 5
_XFUNCPROTOBEGIN
extern char *_Xsetlocale(
int /* category */,
_Xconst char* /* name */
);
_XFUNCPROTOEND
#define setlocale _Xsetlocale
#include <stddef.h>
#endif /* X_LOCALE */
Installing gtk 1.2 (package name gtk1) with macports chokes on the final make, in libintl.h line 440.
extern locale_t libintl_newlocale (junk, stuff, stuff)
The compiler can't find locale_t, and I'm not doing any better.
The file imports locale.h, which doesn't exist, and xlocale.h, which doesn't define this type.
Where should locale_t be defined? This might be as easy as a missed dependency, but I don't know what is missing.
By request, here is xlocale.h, minus the copyright, which is the Open Group's.
#include <X11/Xfuncproto.h>
#include <X11/Xosdefs.h>
#ifndef X_LOCALE
#include <locale.h>
#else
#define LC_ALL 0
#define LC_COLLATE 1
#define LC_CTYPE 2
#define LC_MONETARY 3
#define LC_NUMERIC 4
#define LC_TIME 5
_XFUNCPROTOBEGIN
extern char *_Xsetlocale(
int /* category */,
_Xconst char* /* name */
);
_XFUNCPROTOEND
#define setlocale _Xsetlocale
#include <stddef.h>
#endif /* X_LOCALE */
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
如果您不需要将消息翻译成英语以外的语言,您可以找到
libintl
的各种虚拟版本,它们可以作为直接替代品。如果我没记错的话,uclibc 包含一个。您还可以在某处添加typedef void *locale_t;
并解决该错误。..这是一个错误。
locale_t
直到 POSIX 2008 才添加到 POSIX,它比libgtk1.2
更新了很多;在那之前,它只是一个 GNU 扩展。无论如何,由于它是一个非常新且未得到广泛支持的功能,因此配置应该对其进行测试,并且仅在存在时才使用它。If you don't need messages translated to languages other than English, you can find various dummy versions of
libintl
which serve as drop-in replacements. If I remember correctly, uclibc includes one. You could also just addtypedef void *locale_t;
somewhere and work around the bug...and this is a bug.
locale_t
was not added to POSIX until POSIX 2008, which is a good bit newer thanlibgtk1.2
; until then, it was a GNU extension. And in any case, since it's a very new and not-widely-supported feature, configure should be testing for it and only using it if it's present.我在 Mac OS X 上遇到了同样的问题。这是由
和
使用_XLOCALE_H_< 引起的/code> 作为包含守卫。如果某物同时包含两者,则实际上只包含其中之一。为了解决该问题,我编辑了
/usr/include/X11/Xlocale.h
并将包含保护更改为_X11_XLOCALE_H_
。此问题已已在上游修复,但尚未修复降到Mac OS X。
I had this same problem on Mac OS X. It was caused by both
<xlocale.h>
and<X11/Xlocale.h>
using_XLOCALE_H_
as the include guard. If something included both, only one of them actually got included. To fix the problem, I edited/usr/include/X11/Xlocale.h
and changed the include guard to_X11_XLOCALE_H_
.This problem was fixed upstream but the fix hasn't yet made it down to Mac OS X.