Android NDK 编译问题集合

error: undefined reference to ‘pthread_spin_XX’

问题:

error: undefined reference to 'pthread_spin_lock'
error: undefined reference to 'pthread_spin_unlock'
error: undefined reference to 'pthread_spin_init'
error: undefined reference to 'pthread_spin_destroy'

解决:
APP_PLATFORM 需要改成 android-24 或以上版本才支持 pthread 自旋锁。
使用 Application.mk 时,做一下修改(使用 Cmake 时也需做对应修改):

...
APP_PLATFORM := android-24
...
发布了60 篇原创文章 · 获赞 26 · 访问量 23万+

猜你喜欢

转载自blog.csdn.net/Kennethdroid/article/details/104721815