Menu

pocketsphinx tutorial won't compile

Help
2015-06-18
2015-06-25
  • Kaleb Goering

    Kaleb Goering - 2015-06-18

    I installed both sphinxbase and pocketsphinx just fine. I checked both

        pkg-config --variable=modeldir pocketsphinx
    

    and

    ~~~~~~~~~~~~~~~~
    pkg-config --cflags --libs pocketsphinx sphinxbase
    ~~~~~~~~~~~~~~~

    They both return the expected value but when I try to compile with

        gcc -o hello_ps hello_ps.c / -DMODELDIR="`pkg-config --variable=modeldir pocketsphinx`"      / `pkg-config --cflags --libs pocketsphinx sphinxbase`
        <command-line>:0:10: error: expected expression before / token
        hello_ps.c:15:17: note: in expansion of macro MODELDIR
                 "-hmm", MODELDIR "/en-us/en-us",
    

    is returned. I have tried defining MODELDIR in the C file but get same error. If I use \ instead of / I get more errors.

     

    Last edit: Kaleb Goering 2015-06-18
    • Nickolay V. Shmyrev

      You need to use exact command line as provided in tutorial with \" as a part of MODELDIR definition.

      In order to understand what do those symbols mean and how do they work you can review documentation on shell:

      http://www.gnu.org/software/bash/manual/bashref.html#Quoting

       
  • Kaleb Goering

    Kaleb Goering - 2015-06-18

    When I do that I get

    ~~~~~~~~~~~~~~~~~~~~~~~~~
    gcc: error: -DMODELDIR="/usr/local/share/pocketsphinx/model": No such file or directory
    gcc: error: -I/usr/local/include: No such file or directory
    ~~~~~~~~~~~~~~~~~~~~~~~~~~

    I have checked both of those directories exist and the files the program wants are in the correct directory.

     

    Last edit: Kaleb Goering 2015-06-18
    • Nickolay V. Shmyrev

      Please provide the full command line and the full compiler output. Please try to follow the tutorial precisely, if you do everything properly it should work.

       

Log in to post a comment.