我關注這個網站:http://cmusphinx.sourceforge.net/2011/05/building-pocketsphinx-on-android/。起初它工作正常。但是當我cmd ndk-build在文件/ jni /。 錯誤是顯示波紋管:關於PocketSphinxAndroidDemo
Compile thumb : sphinxutil <= sbthread.c
Compile thumb : sphinxutil <= utf8.c
StaticLibrary : libsphinxutil.a
SharedLibrary : libpocketsphinx_jni.so
/home/tian/develop/android-ndk-r8c/toolchains/arm-linux-androideabi-4.6/
prebuilt/linux-x86/bin/../lib/gcc/arm-linux-androideabi/4.6/../../../../arm-linux-androideabi/bin/ld: /home/tian/桌面/PocketSphinxAndroidDemo/obj/local/armeabi/objs-debug/pocketsphinx_jni/pocketsphinx_wrap.o: in function nbest_s_hyp:/home/tian/桌面/PocketSphinxAndroidDemo/jni/pocketsphinx_wrap.c:793: error: undefined reference to 'new_Hypothesis'
/home/tian/develop/android-ndk-r8c/toolchains/arm-linux-androideabi-4.6/prebuilt/linux-x86/bin/../lib/gcc/arm-linux-androideabi/4.6/../../../../arm-linux-androideabi/bin/ld: /home/tian/桌面/PocketSphinxAndroidDemo/obj/local/armeabi/objs-debug/pocketsphinx_jni/pocketsphinx_wrap.o: in function ps_decoder_s_getHyp:/home/tian/桌面/PocketSphinxAndroidDemo/jni/pocketsphinx_wrap.c:847: error: undefined reference to 'new_Hypothesis'
collect2: ld returned 1 exit status
make: *** [/home/tian/桌面/PocketSphinxAndroidDemo/obj/local/armeabi/libpocketsphinx_jni.so] Error 1
最有可能你建了錯誤的版本。請確保您按照上述博客文章的建議下載了sphinxbase快照和pocketsphinx快照。請確保你使用了swig-1.3,而不是swig-2.0。 –
是的,我使用SWIG版本1.3.40,但它不能正常工作 –
請提供完整的構建日誌。請確保使用swig重新創建了pocketsphinx_wrap.c。請確保您使用的是快照版本。 –