2

I am trying to run my code using the library pocketsphinx. Even though I have used the .lib files for the library it still isn't working. My code:

#include "stdafx.h"
#include <pocketsphinx.h>
#define MODELDIR "c:/sphinx/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);
    return 0;
}

Errors:

Error   LNK2019 unresolved external symbol _cmd_ln_init referenced in function _main
Error   LNK2019 unresolved external symbol _ps_args referenced in function _main
  • Possible duplicate of [What is an undefined reference/unresolved external symbol error and how do I fix it?](https://stackoverflow.com/questions/12573816/what-is-an-undefined-reference-unresolved-external-symbol-error-and-how-do-i-fix) – Ken White Aug 25 '17 at 17:04
  • 3
    I'm only experienced with C, but share your makefile and/or linker command as well. You're likely just not linking against the proper library. – mindcruzer Aug 25 '17 at 17:05
  • I have checked and double checked but I am sure that my project is linked to the .lib files correctly. –  Aug 25 '17 at 20:34

0 Answers0