使用pocketsphinx_wrap.c构建适用于Android的PocketSphinx演示项目时出错

时间:2011-04-27 15:44:59

标签: android android-ndk-r5

我已经下载了这3个项目: PocketSphinxAndroidDemo pocketsphinx sphinxbase

我更新了C:\ android-ndk-r5b \ samples \ PocketSphinxAndroidDemo \ jni \ Android.mk文件 006行:SPHINX_PATH:= / home / eliana / android-ndk-r5b / samples

但是在那一刻,我尝试运行ndk-build来创建libpocketsphinx_jni.so文件:/ home / eliana / android-ndk-r5b / ndk-build V = 1 NDK_LOG = 1,使用pocketsphinx_wrap出现以下错误.c具体来说:

/home/eliana/android-ndk-r5b/samples/PocketSphinxAndroidDemo/jni/pocketsphinx_wrap.c:757:26: error: pocketsphinx.h: No such file or directory
/home/eliana/android-ndk-r5b/samples/PocketSphinxAndroidDemo/jni/pocketsphinx_wrap.c:758:28: error: sphinxbase/err.h: No such file or directory
/home/eliana/android-ndk-r5b/samples/PocketSphinxAndroidDemo/jni/pocketsphinx_wrap.c: In function 'new_Hypothesis':
/home/eliana/android-ndk-r5b/samples/PocketSphinxAndroidDemo/jni/pocketsphinx_wrap.c:777: warning: initialization makes pointer from integer without a cast
/home/eliana/android-ndk-r5b/samples/PocketSphinxAndroidDemo/jni/pocketsphinx_wrap.c:779: warning: assignment makes pointer from integer without a cast
/home/eliana/android-ndk-r5b/samples/PocketSphinxAndroidDemo/jni/pocketsphinx_wrap.c:781: warning: assignment makes pointer from integer without a cast
/home/eliana/android-ndk-r5b/samples/PocketSphinxAndroidDemo/jni/pocketsphinx_wrap.c: In function 'new_Config__SWIG_0':
/home/eliana/android-ndk-r5b/samples/PocketSphinxAndroidDemo/jni/pocketsphinx_wrap.c:792: error: 'FALSE' undeclared (first use in this function)
/home/eliana/android-ndk-r5b/samples/PocketSphinxAndroidDemo/jni/pocketsphinx_wrap.c:792: error: (Each undeclared identifier is reported only once
/home/eliana/android-ndk-r5b/samples/PocketSphinxAndroidDemo/jni/pocketsphinx_wrap.c:792: error: for each function it appears in.)
/home/eliana/android-ndk-r5b/samples/PocketSphinxAndroidDemo/jni/pocketsphinx_wrap.c: In function 'new_Config__SWIG_1':
/home/eliana/android-ndk-r5b/samples/PocketSphinxAndroidDemo/jni/pocketsphinx_wrap.c:796: error: 'FALSE' undeclared (first use in this function)
/home/eliana/android-ndk-r5b/samples/PocketSphinxAndroidDemo/jni/pocketsphinx_wrap.c: In function 'Config_getString':
/home/eliana/android-ndk-r5b/samples/PocketSphinxAndroidDemo/jni/pocketsphinx_wrap.c:827: warning: return makes pointer from integer without a cast
/home/eliana/android-ndk-r5b/samples/PocketSphinxAndroidDemo/jni/pocketsphinx_wrap.c: In function 'new_Decoder__SWIG_0':
/home/eliana/android-ndk-r5b/samples/PocketSphinxAndroidDemo/jni/pocketsphinx_wrap.c:836: error: 'FALSE' undeclared (first use in this function)
/home/eliana/android-ndk-r5b/samples/PocketSphinxAndroidDemo/jni/pocketsphinx_wrap.c: In function 'new_Decoder__SWIG_1':
/home/eliana/android-ndk-r5b/samples/PocketSphinxAndroidDemo/jni/pocketsphinx_wrap.c:840: warning: initialization makes pointer from integer without a cast
/home/eliana/android-ndk-r5b/samples/PocketSphinxAndroidDemo/jni/pocketsphinx_wrap.c: In function 'Decoder_getConfig':
/home/eliana/android-ndk-r5b/samples/PocketSphinxAndroidDemo/jni/pocketsphinx_wrap.c:844: warning: return makes pointer from integer without a cast
/home/eliana/android-ndk-r5b/samples/PocketSphinxAndroidDemo/jni/pocketsphinx_wrap.c: In function 'Decoder_getUttid':
/home/eliana/android-ndk-r5b/samples/PocketSphinxAndroidDemo/jni/pocketsphinx_wrap.c:853: warning: return makes pointer from integer without a cast
/home/eliana/android-ndk-r5b/samples/PocketSphinxAndroidDemo/jni/pocketsphinx_wrap.c: In function 'Decoder_getHyp':
/home/eliana/android-ndk-r5b/samples/PocketSphinxAndroidDemo/jni/pocketsphinx_wrap.c:866: error: 'int32' undeclared (first use in this function)
/home/eliana/android-ndk-r5b/samples/PocketSphinxAndroidDemo/jni/pocketsphinx_wrap.c:866: error: expected ';' before 'best_score'
/home/eliana/android-ndk-r5b/samples/PocketSphinxAndroidDemo/jni/pocketsphinx_wrap.c:867: error: 'best_score' undeclared (first use in this function)
/home/eliana/android-ndk-r5b/samples/PocketSphinxAndroidDemo/jni/pocketsphinx_wrap.c: In function 'Java_edu_cmu_pocketsphinx_pocketsphinxJNI_Decoder_1processRaw_1_1SWIG_10':
/home/eliana/android-ndk-r5b/samples/PocketSphinxAndroidDemo/jni/pocketsphinx_wrap.c:1435: warning: assignment discards qualifiers from pointer target type
make: *** [/home/eliana/android-ndk-r5b/samples/PocketSphinxAndroidDemo/obj/local/armeabi/objs-debug/pocketsphinx_jni/pocketsphinx_wrap.o] Error 1

我感谢任何帮助,因为在Android上尝试使用PocketSphinx非常重要。

谢谢,

2 个答案:

答案 0 :(得分:2)

尝试将您的floders名称sphinxbase.X.X和pocketsphinx.X.X更改为sphinxbase和pocketsphinx

希望这会有所帮助

答案 1 :(得分:0)

我认为你在android.mk中给出了错误的路径 如果你下载项目然后你会发现在相同的路径上存在pocketsphinxdemo你会发现两个文件夹“pocketsphinx”和“sphinxbase” 这是您需要在项目中的android make文件中指定的路径

我希望这会有所帮助 amal:)