L012Linux和androidNDK之执行报错CANNOT LINK EXECUTABLE: cannot locate symbol "signal" referenced by

执行报错:

CANNOT LINK EXECUTABLE: cannot locate symbol "signal" referenced by

解决办法

signal was an inline function until platform android-21, now it's not inline anymore.

When you use the ndk r10, android-21 is used by default but it's not fully retro-compatible with devices running former Android versions. In your case, signal can't be found on your device (but it would run properly on Lollipop).

When using the NDK, you should use the platform (APP_PLATFORM:=android-XX) that corresponds to your android:minSdkVersion.

So here you can set APP_PLATFORM:=android-15 inside Application.mk Makefile, and your lib will use the inline version of signal, so it will not look for its symbol at runtime.

即在Application.mk中增加如下设置

APP_PLATFORM := android-16

    原文作者:夏大王2019
    原文地址: https://www.jianshu.com/p/1bac3d16102a
    本文转自网络文章,转载此文章仅为分享知识,如有侵权,请联系博主进行删除。
点赞