Android的NDK的构建错误 [英] android ndk-build error

查看:302
本文介绍了Android的NDK的构建错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想建立的tesseract为Android。
我已经把在的tesseract样本文件夹

I am trying to build tesseract for android. I have put tesseract in samples folder as

C:\\ Android_NDK \\ Android的NDK-R8 \\样本\\的tesseract
的tesseract 文件夹我有的tesseract-3.00 文件夹, leptonlib-1.66 文件夹和的libjpeg 文件夹中。
每当我试图建立code。使用NDK的构建。
我得到误差

C:\Android_NDK\android-ndk-r8\samples\tesseract with in tesseract folder I have tesseract-3.00 folder, leptonlib-1.66 folder and libjpeg folder. Whenever I try to build the code using ndk-build. I get error as

C:/Android_NDK/android-ndk-r8/build/core/build-binary.mk:240:***目标模式
 不包含%。停止。

我使用NDK,建立这样的命令提示符
<$c$c>C:\\Android_NDK\\android-ndk-r8\\samples\\tesseract\\jni>C:\\Android_NDK\\android-ndk-r8/ndk-build

I use ndk-build like this in Command Prompt C:\Android_NDK\android-ndk-r8\samples\tesseract\jni>C:\Android_NDK\android-ndk-r8/ndk-build

Application.mk 的tesseract中/ JNI文件夹搜索文件内容
    #v7是significanly更快由于使用硬件FPU结果的
     APP_STL:= gnustl_static结果
     APP_ABI:= armeabi armeabi,V7A结果
     APP_OPTIM:=发行结果
     APP_CPPFLAGS + = -fexceptions -frtti

Application.mk file contents in tesseract/jni folder
# ARMv7 is significanly faster due to the use of the hardware FPU
APP_STL := gnustl_static
APP_ABI := armeabi armeabi-v7a
APP_OPTIM := release
APP_CPPFLAGS += -fexceptions -frtti

 Android.mk file contents in tesseract/jni folder  
# NOTE: You must set these variables to their respective source paths before
# compiling. For example, set LEPTONICA_PATH to the directory containing
# the Leptonica configure file and source folders. Directories must be
# root-relative, e.g. TESSERACT_PATH := /home/username/tesseract-3.00
#
# To set the variables, you can run the following shell commands:
# export TESSERACT_PATH=<path-to-tesseract>
# export LEPTONICA_PATH=<path-to-leptonica>
# export LIBJPEG_PATH=<path-to-libjpeg>
#
# Or you can fill out and uncomment the following definitions:
# TESSERACT_PATH := <path-to-tesseract>
# LEPTONICA_PATH := <path-to-leptonica>
# LIBJPEG_PATH := <path-to-libjpeg>

ifeq "$(TESSERACT_PATH)" ""
  $(error You must set the TESSERACT_PATH variable to the Tesseract source \
      directory. See README and jni/Android.mk for details)
endif

ifeq "$(LEPTONICA_PATH)" ""
  $(error You must set the LEPTONICA_PATH variable to the Leptonica source \
      directory. See README and jni/Android.mk for details)
endif

ifeq "$(LIBJPEG_PATH)" ""
  $(error You must set the LIBJPEG_PATH variable to the Android JPEG \
      source directory. See README and jni/Android.mk for details)
endif

# Just build the Android.mk files in the subdirs
include $(call all-subdir-makefiles) $(LIBJPEG_PATH)/Android.mk

试图与Cygwin的,但同样的问题。

Tried with Cygwin but the same problem.

期待您的回复。

感谢。

推荐答案

我觉得你没有添加低于code到您的buid.gradle文件。这个解决方案的Andr​​oid FO工作室

I think you not added below code to your buid.gradle file .This solution fo android studio

 sourceSets.main {
    jniLibs.srcDir 'src/main/libs'
    jni.srcDirs = [] //disable automatic ndk-build call
}

这篇关于Android的NDK的构建错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆