14

我想在 android studio 中导入 tess-two 库,编译后在 ndk build 中显示错误。我已经尝试过在 stackoverflow 上给出的解决方案。像, 任务':app:compileDebugNdk'的执行失败, 但它没有解决我的问题。请建议我在哪里做错了。

它显示以下错误:

Error:error: undefined reference to 'isnanf'

Error:error: undefined reference to '__isinff'
Error:error: undefined reference to 'isnanf'
[arm64-v8a] Install        : libtess.so => libs/arm64-v8a/libtess.so
Error:error: undefined reference to 'isnanf'
Error:error: undefined reference to '__isinff'
Error:error: undefined reference to 'isnanf'
[x86_64] Install        : libjpgt.so => libs/x86_64/libjpgt.so
Error:error: linker command failed with exit code 1 (use -v to see invocation)
Error:error: linker command failed with exit code 1 (use -v to see invocation)
make: *** [obj/local/armeabi-v7a/libtess.so] Error 1

make: *** Waiting for unfinished jobs....
make: *** [obj/local/armeabi/libtess.so] Error 1
make: Leaving directory `D:/OCR/tess-two-master/tess-two-master/tess-two'
:tess-two:ndkBuild FAILED

Error:Execution failed for task ':tess-two:ndkBuild'.
Process 'command 'D:\SDK\sdk\ndk-bundle/ndk-build.cmd'' finished with non-zero exit value 2  
4

1 回答 1

11

事实证明,这个错误的根本原因是 NDK r11 不支持 android-8 (Android 2.2.x),而 NDK r10 支持。

更改 Application.mk 文件以使用APP_PLATFORM := android-9可修复此问题。

于 2016-03-26T21:52:35.220 回答