c - Unresolved symbols building pocketsphinx application -


im trying started using pocketsphinx 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 `ps_args' pocketsphinx.c:(.text+0x6b): undefined reference `cmd_ln_init' collect2: error: ld returned 1 exit status 

every time run 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 link 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 location of libpocketphinx.so, libsphinxbase.so , libsphinxad.so using prefix provided includes.


Comments

Popular posts from this blog

jOOQ update returning clause with Oracle -

java - Warning equals/hashCode on @Data annotation lombok with inheritance -

java - BasicPathUsageException: Cannot join to attribute of basic type -