我想在android studio中导入tess-two库,编译后在ndk build中显示错误。我已经尝试在stackoverflow上给出解决方案。 喜欢 , Execution failed for task ':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
答案 0 :(得分:12)
事实证明,此错误的根本原因是NDK r11不支持android-8(Android 2.2.x),而NDK r10则支持。
将Application.mk文件更改为使用APP_PLATFORM := android-9
可以解决此问题。