【发布时间】:2012-06-22 11:09:49
【问题描述】:
我正在尝试为 android 构建 tesseract。 我已将 tesseract 作为
放在示例文件夹中C:\Android_NDK\android-ndk-r8\samples\tesseract
在tesseract 文件夹中,我有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
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 试过,但同样的问题。
期待您的回复。
谢谢。
【问题讨论】:
-
您能否发布您的 mk 文件,以便我们查看更多信息。
-
@codetiger 我已附上 mk 文件详细信息。
-
请查看question 和forum post。您的错误似乎与 Windows 路径中的“:”符号有关,该符号被视为模式匹配
-
@AndreyErmakov 我们如何避免在 Windows 中使用 ':' 符号?
标签: android android-ndk tesseract