error in integration of mupdf library
Asked Answered
R

5

6

I am working on a project in which i have to deal with pdf view. I am trying to integrate mupdf library in my project but getting error as mentioned below. I have followed all steps mentioned in readme document. please help me to solve this error.

Compile thumb : mupdf <= mupdf.c

jni/mupdf.c:10:18: fatal error: fitz.h: No such file or directory
compilation terminated.
make: *** [obj/local/armeabi/objs-debug/mupdf/mupdf.o] Error 1

My Android.mk file

    LOCAL_PATH := $(call my-dir)
TOP_LOCAL_PATH := $(LOCAL_PATH)

MUPDF_ROOT := $(call my-dir)

include $(TOP_LOCAL_PATH)/Core.mk
include $(TOP_LOCAL_PATH)/ThirdParty.mk

include $(CLEAR_VARS)

LOCAL_C_INCLUDES := \
    $(MUPDF_ROOT)/draw \
    $(MUPDF_ROOT)/fitz \
    $(MUPDF_ROOT)/mupdf
LOCAL_CFLAGS :=
LOCAL_MODULE    := mupdf
LOCAL_SRC_FILES := mupdf.c
LOCAL_STATIC_LIBRARIES := mupdfcore mupdfthirdparty

LOCAL_LDLIBS    := -lm -llog -ljnigraphics

include $(BUILD_SHARED_LIBRARY)

Thanks in advance.

Raffia answered 28/8, 2012 at 12:57 Comment(6)
Do you have the fitz.h file somewhere?Pseudonym
yes its placed inside fitz folder of mupdf library.Raffia
Do you have more than 1 fitz.h?? If yes, than it creates ambiguity.Cleavable
Do you have "$(MUPDF_ROOT)/fitz" in the include list of your your Android.mk file?Pseudonym
yes its there. please check my android.mk file i have uploaded in my question.Raffia
my MUPDF_ROOT is "..", not "$(call my-dir)"Pseudonym
S
0

You should invoke ./scripts/build-native.sh (for Windows use cygwin), then run ndk-build

Saimon answered 10/2, 2013 at 15:51 Comment(1)
how to do this. i m getting this while executing this $ ./scripts/build-native.sh -bash: ./scripts/build-native.sh: No such file or directorySoftwood
L
6

This is how i succeeded in MuPDF.

download ndk and extract. download cygwin and extract. download mupdf source and thirdparty files.

extract source and thirdpart extract file add to here.

go to project directory using cygwin.

open project in eclipse and add this to application.mk

      NDK_TOOLCHAIN_VERSION=4.4.3

make header file using this command in cygwin

javah -jni -classpath bin/classes/ -d jni/ com.artifex.mupdf.MuPDFActivity

use cd .. and go back to MupdfSource extract directory and execute

    make

then error come .Use

make NOX11=yes

go to project directory (android folder) in cygwin and

ndk-build

thats all you get .so file

run the project.

Sorry for the bad English.

Lhasa answered 5/9, 2012 at 10:42 Comment(2)
Thank You so much.. Really very nice description..thnx againTartuffery
How to make command: javah -jni -classpath bin/classes/ -d jni/ com.artifex.mupdf.MuPDFActivity a tryed run, but getting error: Error: cannot access android.app.Activity class file for android.app.Activity not foundQr
C
1

You have to run make command using Cygwin.

Cleavable answered 28/8, 2012 at 13:7 Comment(2)
Just go to android folder in mupdf you have downloaded, and read README file from there.Cleavable
get this error when run make cp thirdparty/openjpeg-1.5.0/libopenjpeg/../opj_config.h.in.user build/debug/opj_config.h cp: cannot stat thirdparty/openjpeg-1.5.0/libopenjpeg/../opj_config.h.in.user': No such file or directory Makethird:51: recipe for target build/debug/opj_config.h' failed make: *** [build/debug/opj_config.h] Error 1Raffia
W
0

Please follow the following this steps

also take care of steps of readme file

Wrigley answered 28/8, 2012 at 13:19 Comment(0)
P
0

Replace MUPDF_ROOT := $(call my-dir) by MUPDF_ROOT := ..

Pseudonym answered 28/8, 2012 at 14:18 Comment(0)
S
0

You should invoke ./scripts/build-native.sh (for Windows use cygwin), then run ndk-build

Saimon answered 10/2, 2013 at 15:51 Comment(1)
how to do this. i m getting this while executing this $ ./scripts/build-native.sh -bash: ./scripts/build-native.sh: No such file or directorySoftwood

© 2022 - 2024 — McMap. All rights reserved.