2

I m trying to compile the muPDF lib in eclipse for android app since 3 days without any success

I downloaded and configured the android-ndk, cygwin

Im getting this still

15:25:36 **** Build of configuration Debug for project ChoosePDFActivity ****
"E:\\android-ndk\\android-ndk-r9d\\ndk-build.cmd" all 
Android NDK: WARNING:E:/Workspace_SIL/ChoosePDFActivity//jni/Android.mk:mupdfcore: LOCAL_LDLIBS is always ignored for static libraries    
Android NDK: WARNING:E:/Workspace_SIL/ChoosePDFActivity//jni/Android.mk:mupdfcore: LOCAL_LDLIBS is always ignored for static libraries    
[armeabi] Compile thumb  : mupdf <= mupdf.c
E:/Workspace_SIL/ChoosePDFActivity//jni/mupdf.c:10:18: fatal error: fitz.h: No such file or directory
compilation terminated.
make.exe: *** [E:/Workspace_SIL/ChoosePDFActivity//obj/local/armeabi/objs-debug/mupdf/mupdf.o] Error 1

15:25:36 Build Finished (took 489ms)

jni/mupdf.c:10:18: fatal error: fitz.h: No such file or directory

where I can get this God Damn fitz.h and other header files

see this happens in my eclipse

enter image description here

included the following paths for my header files

enter image description here

setup android Ndk path like this

enter image description here

enter image description here

Update1

Here is my Android.mk file

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

MUPDF_ROOT := ..

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)/pdf
LOCAL_CFLAGS :=
LOCAL_MODULE    := mupdf
LOCAL_SRC_FILES := mupdf.c
LOCAL_STATIC_LIBRARIES := mupdfcore mupdfthirdparty

LOCAL_LDLIBS    := -lm -llog -ljnigraphics

include $(BUILD_SHARED_LIBRARY)
Qadir Hussain
  • 8,721
  • 13
  • 89
  • 124
  • Hi, maybe I would ask a stupid question but, do you really need to compile it? Have you done or are you planning to do some changes in MuPDF NDK? If not, you can download already compiled version of MuPDF library for Android and there is no need to compile it again. – Luboš Staráček Jul 04 '14 at 10:17
  • 1
    @LubošStaráček may be im wrong. I have to integrate muPDF in my android app. I want read/view some pdf stuff in my app. Im following this http://www.mupdf.com/docs/how-to-build-mupdf-for-android but got error while MAKING the NDK code in JNI folder . posted a news question also here http://stackoverflow.com/questions/24545152/compiling-mupdf-lib-in-eclipse-cannot-unlink-nul-invalid-argument-android-nd – Qadir Hussain Jul 06 '14 at 17:44
  • Since you would not do any changes in NDK code, I believe you do not need to compile it. You can download some project from GitHub that is already using compiled MuPDF and use it in your app (e.g. https://github.com/joniks/Android-MuPDF). You can add this source to your project, edit layout and use it as you like (I think MuPDF has GPL2 licence, therefore you can use it for open-source or not-commercial purposes only) – Luboš Staráček Jul 07 '14 at 08:34
  • @LubošStaráček I have just followd the MuPDF build for android instructions. Do I now just import that build into my android project in Android Studio? I am having a heck of a time learning how to do this. – silversunhunter Nov 25 '14 at 06:04
  • 1
    @silversunhunter I have no experience with Android Studio and AIK it has different build system than Eclipse, so... sorry, I can't help. However, I assume all you need is to download library project from link I provided earlier (github.com/joniks/Android-MuPDF) and add it to your project. You can find a lot of tutorials how to import a library into a project in Android Studio. – Luboš Staráček Nov 27 '14 at 16:04

3 Answers3

0

Check the jni folder and find the Anroid.mk. Open it and check whether you added the LOCAL_SRC_FILES and LOCAL_C_INCLUDES. The LOCAL_C_INCLUDES should be your .h files' path. The LOCAL_SRC_FILES should be every .c or .cpp file's path.

Kill Console
  • 1,933
  • 18
  • 15
0

cygwin no t install properly, follow following links and sure your installations correctly than run some commands according to below links.

For window 7

For window XP

Engr Waseem Arain
  • 1,163
  • 1
  • 17
  • 36
0

You're also using an old version of the MuPDF source code.

1) Use the latest version (1.5 currently, or better, work from git).

2) Don't build it using eclipse, use the supported ndk/sdk based build as described in platform/android/ReadMe.txt. If you want to use eclipse, do so only after you have managed to build it in the supported way.

3) Do not skip step 10 of the instructions. Seriously, why does everyone try to skip step 10?

4) If you get stuck, come talk to us in the #ghostscript irc channel on freenode. A weblink can be found to this on mupdf.com

Robin Watts
  • 727
  • 1
  • 4
  • 10