错误:使用不同类型的 Typedef 重定义
error: typedef redefinition with different types
我尝试使用 NDK 在 Android Studio 中编译 c++ 库,但出现一些错误:
C:AndroidSDKndk-bundletoolchainsllvmprebuiltwindows-x86_64bin..lib64clang3.8.275480includestddef.h:62:23: error: typedef redefinition with different types ('unsigned long' vs 'unsigned int') typedef __SIZE_TYPE__ size_t; ^../../../../src/main/cpp/includeCrypto/Core/Types.h:20:22: note: previous definition is here typedef unsigned int size_t;
当我定义
typedef unsigned long size_t;
我得到:
C:AndroidSDKndk-bundletoolchainsllvmprebuiltwindows-x86_64bin..lib64clang3.8.275480includestddef.h:62:23: error: typedef redefinition with different types ('unsigned int' vs 'unsigned long') typedef __SIZE_TYPE__ size_t;^ ../../../../src/main/cpp/includeCrypto/Core/Types.h:20:23: note: previous definition is here typedef unsigned long size_t;
我该如何解决它?
size_t
已经是由几个 C/C++ 标准定义的数据类型。尝试键入定义语言中尚未定义的其他内容。
例:-
typedef unsigned long my_size_t;
不能使用 typedef
重新定义size_t
。如果要有一个 32 位无符号整数,可以编写:
typedef unsigned long u32t
相关文章:
- 有没有一种方法可以通过"typedef"为重新定义的基本类型定义特征和强制转换运算符
- 如何重新定义MPI_FLOAT,MPI_DOUBLE以 typedef 的方式
- 使用LASlib时BOOL typedef重新定义
- "typedef"类型名称是否可以像"struct"定义那样声明指向结构的指针?
- 具有未声明/未定义类型的 typedef 结构
- typedef 应该同时在类定义和类声明中吗?
- 定义 ostream 运算符<<用于类中定义的 typedef
- 模板化类,包含由 typedef 定义的类对象的向量.如何称呼它们
- C 通过Typedef定义新类型
- Typedef已定义的功能
- 这个 typedef 定义是什么意思
- C++ - 有没有办法将字段\方法添加到使用"typedef"定义的类型?
- C++:使用"typedef"定义的类作为参数进行传递
- 如何检查类型是通过 typedef 定义的还是在模板参数中使用定义的
- 奇怪的typedef定义C++
- 在类中使用typedef定义指向父类函数的函数指针
- 如何使用typeid获取使用typedef定义的类型名称
- 类型由其他模板类的内部typedef定义的模板实参
- 2个相似的typedef定义的差异
- 在define宏中使用typedef定义函数