Mac v3.10 新建项目 直接编译android 报错

SharedLibrary : libcocos2djs.so
/Applications/Cocos/Cocos2d-x/cocos2d-x-3.10/external/spidermonkey/prebuilt/android/armeabi/libjs_static.a(ExecutableAllocatorPosix.o):function JSC::ExecutableAllocator::determinePageSize(): error: undefined reference to ‘__page_size’
/Users/jenkins/Public/jenkins/workspace/CCS-AutoBuild-Mono_3.5/label/mac02/cocos2dx/tools/simulator/frameworks/runtime-src/proj.android/…/…/…/…/…/cocos//./base/CCConsole.cpp:382: error: undefined reference to ‘bzero’
/Applications/Cocos/Cocos2d-x/cocos2d-x-3.10/external/websockets/prebuilt/android/armeabi/libwebsockets.a(context.c.o):context.c:function libwebsocket_create_context: error: undefined reference to ‘getdtablesize’
/Applications/Cocos/Cocos2d-x/cocos2d-x-3.10/external/websockets/prebuilt/android/armeabi/libwebsockets.a(lws-plat-unix.c.o):lws-plat-unix.c:function lws_plat_context_early_init: error: undefined reference to ‘bsd_signal’
/Applications/Cocos/Cocos2d-x/cocos2d-x-3.10/external/websockets/prebuilt/android/armeabi/libwebsockets.a(lws-plat-unix.c.o):lws-plat-unix.c:function lws_plat_context_early_init: error: undefined reference to ‘bsd_signal’
/Applications/Cocos/Cocos2d-x/cocos2d-x-3.10/external/websockets/prebuilt/android/armeabi/libwebsockets.a(daemonize.c.o):daemonize.c:function lws_daemonize: error: undefined reference to ‘bsd_signal’
/Applications/Cocos/Cocos2d-x/cocos2d-x-3.10/external/websockets/prebuilt/android/armeabi/libwebsockets.a(daemonize.c.o):daemonize.c:function lws_daemonize: error: undefined reference to ‘bsd_signal’
collect2: error: ld returned 1 exit status
make: *** Error 1

换了ndk r10e OK 了

使用 ndk r14b + 3.8.1 预编译库遇到该问题,在自己工程目录 Android.mk 添加

LOCAL_ALLOW_UNDEFINED_SYMBOLS := true

以解决这个问题 ~

link: https://stackoverflow.com/questions/22159183/android-ndk-jni-undefined-reference-to-function-defined-in-custom-header-fil