android 编译 icu,编译ICU for Android – ‘uint64_t’没有命名类型

尝试在

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

这是由#include< sys / types.h>触发的.在icu / source / common / unicode / ptypes.h中:25.它似乎是android-ndk-n7中的一个非icu问题.在sys / types.h中我们看到

#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

这里的culprint是uint64_t,它在#include< stdint.h>中定义.在sys / types.h的顶部.我们在这里看到

#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的任何代码也会抛出相同的错误.我的临时解决方法是在#include< sys / types.h>之前在icu的ptypes.h顶部定义STDC_INT64.这是一个坏主意吗?

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值