本文介绍了未解决的符号建筑pocketsphinx应用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我尝试使用pocketsphinx上手,但我得到这个错误:
的gcc -I /家庭/ noahchalifour /库/ pocketsphinx /包括-I /家庭/ noahchalifour /库/ sphinxbase /包括pocketsphinx.c -o pocketsphinx
/tmp/ccagvqgz.o:在函数'主':
。pocketsphinx.c :(文字+ 0x20的):未定义的参考`ps_args
pocketsphinx.c :(文字+ 0x6b):未定义的参考`cmd_ln_init
collect2:错误:LD返回1退出状态
我每次运行此code:
的#include< pocketsphinx.h>#定义MODELDIR/家庭/库/ pocketsphinx /模式INT主(INT ARGC,CHAR *的argv [])
{
ps_de coder_t * PS = NULL;
cmd_ln_t *配置= NULL; 配置= cmd_ln_init(NULL,ps_args(),TRUE,
-hmm,MODELDIR/ EN-US / EN-US
-lm,MODELDIR/en-us/en-us.lm.bin
-dict,MODELDIR/en-us/cmudict-en-us.dict
空值); 的printf(成功\\ n!); 返回0;
}
解决方案
您也应该链接到 pocketsphinx
库:
的gcc -I /家庭/ noahchalifour /库/ pocketsphinx /包括\\
-I /家庭/ noahchalifour /库/ sphinxbase /包括\\
-L /家庭/ noahchalifour /库/ pocketsphinx / lib目录\\
-L /家庭/ noahchalifour /库/ sphinxbase / lib目录\\
-lpocketsphinx -lsphinxbase -lsphinxad
pocketsphinx.c -o pocketsphinx
我猜 libpocketphinx.so
, libsphinxbase.so
的位置和 libsphinxad。所以
使用为包括
im trying to get started using pocketsphinx but I get this error:
gcc -I /home/noahchalifour/libraries/pocketsphinx/include -I /home/noahchalifour/libraries/sphinxbase/include pocketsphinx.c -o pocketsphinx
/tmp/ccagvqgz.o: In function `main':
pocketsphinx.c:(.text+0x20): undefined reference to `ps_args'
pocketsphinx.c:(.text+0x6b): undefined reference to `cmd_ln_init'
collect2: error: ld returned 1 exit status
every time I run this code:
#include <pocketsphinx.h>
#define MODELDIR "/home/libraries/pocketsphinx/model"
int main(int argc, char *argv[])
{
ps_decoder_t *ps = NULL;
cmd_ln_t *config = NULL;
config = cmd_ln_init(NULL, ps_args(), TRUE,
"-hmm", MODELDIR "/en-us/en-us",
"-lm", MODELDIR "/en-us/en-us.lm.bin",
"-dict", MODELDIR "/en-us/cmudict-en-us.dict",
NULL);
printf("Success!\n");
return 0;
}
解决方案
You should also link to the pocketsphinx
library:
gcc -I /home/noahchalifour/libraries/pocketsphinx/include \
-I /home/noahchalifour/libraries/sphinxbase/include \
-L /home/noahchalifour/libraries/pocketsphinx/lib \
-L /home/noahchalifour/libraries/sphinxbase/lib \
-lpocketsphinx -lsphinxbase -lsphinxad
pocketsphinx.c -o pocketsphinx
I guessed the location of libpocketphinx.so
, libsphinxbase.so
and libsphinxad.so
using the prefix you provided for the includes.
这篇关于未解决的符号建筑pocketsphinx应用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!