gpt4 book ai didi

android ndk构建错误

转载 作者:太空宇宙 更新时间:2023-11-03 10:27:00 28 4
gpt4 key购买 nike

我正在尝试为 android 构建 tesseract。我已将 tesseract 放在 samples 文件夹中作为

C:\Android_NDK\android-ndk-r8\samples\tesseracttesseract文件夹我有 tesseract-3.00文件夹,leptonlib-1.66文件夹和 libjpeg文件夹。每当我尝试使用 ndk-build 构建代码时。我收到错误

C:/Android_NDK/android-ndk-r8/build/core/build-binary.mk:240: *** target pattern
contains no '%'. Stop.

我在命令提示符中像这样使用 ndk-build C:\Android_NDK\android-ndk-r8\samples\tesseract\jni>C:\Android_NDK\android-ndk-r8/ndk-build

Application.mk tesseract/jni 文件夹中的文件内容
# ARMv7 is significanly faster due to the use of the hardware FPU<br/>
APP_STL := gnustl_static<br/>
APP_ABI := armeabi armeabi-v7a<br/>
APP_OPTIM := release<br/>
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 但同样的问题。

期待您的回复。

谢谢。

最佳答案

我认为你没有将下面的代码添加到你的build.gradle文件中。android studio的这个解决方案

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

关于android ndk构建错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11155054/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com