【发布时间】:2012-02-12 07:20:12
【问题描述】:
在Linux中尝试使用android-ndk-r7交叉编译ICU时,运行'make'时配置后出现以下错误
__/android-ndk-r7/platforms/android-8/arch-arm/usr/include/sys/types.h:124: error: 'uint64_t' does not name a type
这是由 icu/source/common/unicode/ptypes.h:25 中的 #include
#ifdef __BSD_VISIBLE
typedef unsigned char u_char;
typedef unsigned short u_short;
typedef unsigned int u_int;
typedef unsigned long u_long;
typedef uint32_t u_int32_t;
typedef uint16_t u_int16_t;
typedef uint8_t u_int8_t;
typedef uint64_t u_int64_t;
#endif
这里的罪魁祸首是 uint64_t,它在 sys/types.h 顶部的#include
#if !defined __STRICT_ANSI__ || __STDC_VERSION__ >= 199901L
# define __STDC_INT64__
#endif
...
#if defined(__STDC_INT64__)
typedef __int64_t int64_t;
typedef __uint64_t uint64_t;
#endif
如果 STRICT_ANSI 或 STDC_VERSION 并因此 STDC_INT64 从未定义,包括 sys/types.h 将抛出错误,因为 uint64_t 从未定义.以后调用 int64_t(发生在 icu 代码中)和 uint64_t 的任何代码也将引发相同的错误。我对此的临时解决方法是在 icu 的 ptypes.h 顶部 #include
【问题讨论】:
标签: android android-ndk icu