标签:was win star lan g++ art arw his 更换
/Users/ahfu/code/android/android-ndk-r14b/toolchains/llvm/prebuilt/darwin-x86_64/bin/clang++ ....
../..//thread_util.cpp:92:7: error: use of undeclared identifier 'atomic_add'
atomic_add(&(obj->m_start_idx), 1);
Application.mk 中加上一行:
NDK_TOOLCHAIN := aarch64-linux-android-4.9
编译出现:
/Users/ahfu/code/android/android-ndk-r14b/toolchains/aarch64-linux-android-4.9/prebuilt/darwin-x86_64/bin/aarch64-linux-android-g++ ...
../..//thread_util.cpp:92:40: error: 'atomic_add' was not declared in this scope
atomic_add(&(obj->m_start_idx), 1);
于是把 atomic_add更换为 __sync_fetch_and_add(&(obj->m_start_idx), 1);
问题解决。
标签:was win star lan g++ art arw his 更换
原文地址:https://www.cnblogs.com/ahfuzhang/p/11623863.html