Problems trying to build PocketSphinx for Android using NDK
Asked Answered
L

2

7

I'm trying to build PocketSphinx for Android using the PocketSphinxAndroidDemo project. I've given up om my quest to build it using Cygwin and Windows and installed an Ubuntu VM. I'm making progress but I seem to be stuck and I can't seem to figure it out. It has to be something simple that I'm missing. The ndk-build gives the following output (clipped):

Compile thumb  : pocketsphinx_jni <= pocketsphinx_wrap.c
/home/user/development/PocketSphinxAndroidDemo/jni/pocketsphinx_wrap.c:760:26: error: pocketsphinx.h: No such file or directory
/home/user/development/PocketSphinxAndroidDemo/jni/pocketsphinx_wrap.c:761:28: error: sphinxbase/err.h: No such file or directory

The header files are (obviously) not in the same folder as the JNI files. The LOCAL_C_INCLUDES flag has been set in Android.mk file to include the needed headers -

include $(CLEAR_VARS)
LOCAL_C_INCLUDES := $(SPHINX_PATH)/sphinxbase/include/android \
            $(SPHINX_PATH)/sphinxbase/include/sphinxbase \
            $(SPHINX_PATH)/sphinxbase/include \
            $(SPHINX_PATH)/pocketsphinx/include

I should note that my SPHINX_PATH variable looks like this, and it's correct -

SPHINX_PATH := ~/development

If I copy the header files over into the /jni/ folder I get farther but then the compiler starts yelling at me for header files missing in other locations. Surely I'm missing something simple. Isn't there somewhere I can set a "Look in these locations for header files before blowing up" flag?

I'm not a C/C++ or a Linux guy so I'm kind of in the dark here. Any help would be greatly appreciated. Thanks!

Lumberyard answered 22/12, 2010 at 2:15 Comment(1)
L
2

Solved my problem. Maybe someone will find this information useful :)

What I did was a complete rebuild of all the static library projects, and then my app, using "ndk-build -B"

Lumberyard answered 23/12, 2010 at 13:23 Comment(2)
I am very new to this project can you please guide me how you resolve this issue by rebuilding all static library project and one more thing from where i would find the static library.Unfathomable
@Ohh This answer is like 2 years old, so I'm not sure if things are still the same. From what I remember (I have long since moved on from this project, haha) there was a build script inside the PocketSphinx source that would rebuild the entire library from scratch.Lumberyard
M
2

Modify jni/Android.mk file

Change Line 162 :

LOCAL_STATIC_LIBRARIES := sphinxutil sphinxfe sphinxfeat sphinxlm pocketsphinx

to :

LOCAL_STATIC_LIBRARIES := pocketsphinx sphinxlm sphinxfeat sphinxfe sphinxutil

That will resolve your issue.

Molluscoid answered 12/4, 2012 at 17:30 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.