Menu

Errors when trying to follow tutorial in pocketsphinx c++

Help
2017-08-23
2017-08-23
  • bunnybot5555

    bunnybot5555 - 2017-08-23

    I copied the example code from the tutorial:https://cmusphinx.github.io/wiki/tutorialpocketsphinx/ but when I compile it get these errors:

    Severity    Code    Description Project File    Line    Suppression State
    Error   C1010   unexpected end of file while looking for precompiled header. Did you forget to add '#include "stdafx.h"' to your source?    
    

    This is the code:

    #include <pocketsphinx.h>
    int
    main(int argc, char *argv[])
    {
        #define MODELDIR "c:/sphinx/model"
        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);
    
        return 0;
    }
    

    How do I fix this?

     

    Last edit: bunnybot5555 2017-08-23
    • Nickolay V. Shmyrev

      Define MODELDIR in project properties or in the code.

       

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.