Problems trying to build PocketSphinx for Android using NDK

血红的双手。 提交于 2019-11-29 14:19:39

问题


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!


回答1:


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"




回答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.



来源:https://stackoverflow.com/questions/4505633/problems-trying-to-build-pocketsphinx-for-android-using-ndk

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!