环境:
protocol buffer: 2.5.0
ndk: android-ndk-r13b
ant: apache-ant-1.9.4
cocos2d-x: 3.12
os: mac 10.12
我已经使用APP_ABI = armeabi-v7a
编译很长时间了(来自https://github.com/protocolbuffers/protobuf/releases/tag/v2.5.0的.h和.cc文件),一切正常。
但是最近我必须将arm64-v8a
添加到APP_ABI中,并且开始出现以下错误:
stubs/once.h:125: undefined reference to
google::protobuf::internal::Acquire_Load(long const volatile*)
然后我检查并发现Acquire_Load
在stubs/atomicops.h
中带有宏:
#ifdef GOOGLE_PROTOBUF_ARCH_64_BIT
// ......
Atomic64 Acquire_Load(volatile const Atomic64* ptr);
// ......
#endif // GOOGLE_PROTOBUF_ARCH_64_BIT
宏GOOGLE_PROTOBUF_ARCH_64_BIT
在stubs/platform_macros.h
中定义:
#if defined(_M_X64) || defined(__x86_64__)
#define GOOGLE_PROTOBUF_ARCH_X64 1
#define GOOGLE_PROTOBUF_ARCH_64_BIT 1
#elif defined(_M_IX86) || defined(__i386__)
#define GOOGLE_PROTOBUF_ARCH_IA32 1
#define GOOGLE_PROTOBUF_ARCH_32_BIT 1
#elif defined(__QNX__)
#define GOOGLE_PROTOBUF_ARCH_ARM_QNX 1
#define GOOGLE_PROTOBUF_ARCH_32_BIT 1
#elif defined(__ARMEL__)
#define GOOGLE_PROTOBUF_ARCH_ARM 1
#define GOOGLE_PROTOBUF_ARCH_32_BIT 1
#elif defined(__MIPSEL__)
#define GOOGLE_PROTOBUF_ARCH_MIPS 1
#define GOOGLE_PROTOBUF_ARCH_32_BIT 1
#elif defined(__pnacl__)
#define GOOGLE_PROTOBUF_ARCH_32_BIT 1
#elif defined(__ppc__)
#define GOOGLE_PROTOBUF_ARCH_PPC 1
#define GOOGLE_PROTOBUF_ARCH_32_BIT 1
#elif defined(__aarch64__)
#define GOOGLE_PROTOBUF_ARCH_ARM 1
#define GOOGLE_PROTOBUF_ARCH_64_BIT 1
#else
#error Host architecture was not detected as supported by protobuf
#endif
我对编译东西不是很熟悉,因此无法弄清楚哪里出了问题。
任何建议将不胜感激,谢谢:)