This project started by installing pocketsphinx from the Debian Stable repository. The installed version is 0.8+5prealpha+1-2+b2
That compiles and runs correctly as
gcc -o pocketsphinx pocketsphinx.c -DMODELDIR=\"pkg-config --variable=modeldir pocketsphinx\" pkg-config --cflags --libs pocketsphinx sphinxbase
Baby steps
gcc -o hello_ps hello.c -DMODELDIR=\"pkg-config --variable=modeldir pocketsphinx\" pkg-config --cflags --libs pocketsphinx sphinxbase
That also works
As far as I can tell, -DMODELDIR invokes QT. I do not understand how that works. My next step was to try to compile gcc -o hello_ps hello.c
i.e. without the extraneous stuff. That resulted in a dozen missing header files, which I obtained from https://cmusphinx.github.io/doc/pocketsphinx
Compile errors stated "unknown file name 'ps_mgau_t'" amd also 'acmod_t'
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Here is a condensed error report:
ms_mgau.h:92:5: error: unknown type name ‘ps_mgau_t’
ms_mgau.h:105:1: error: unknown type name ‘ps_mgau_t’;
ms_mgau.h:105:25: error: unknown type name ‘acmod_t’;
ms_mgau.h:106:19: error: unknown type name ‘ps_mgau_t’;
ms_mgau.h:107:31: error: unknown type name ‘ps_mgau_t’;
ms_mgau.h:114:30: error: unknown type name ‘ps_mgau_t’;
Attempting to compile (gcc, Linux) Pocketsphinx, I get the subject errors from ms_mgau.h
??
Please provide more information on the problem to get help (steps, logs, errors, environment)
This project started by installing pocketsphinx from the Debian Stable repository. The installed version is 0.8+5prealpha+1-2+b2
That compiles and runs correctly as
gcc -o pocketsphinx pocketsphinx.c -DMODELDIR=\"
pkg-config --variable=modeldir pocketsphinx
\"pkg-config --cflags --libs pocketsphinx sphinxbase
Baby steps
gcc -o hello_ps hello.c -DMODELDIR=\"
pkg-config --variable=modeldir pocketsphinx
\"pkg-config --cflags --libs pocketsphinx sphinxbase
That also works
As far as I can tell, -DMODELDIR invokes QT. I do not understand how that works. My next step was to try to compile
gcc -o hello_ps hello.c
i.e. without the extraneous stuff. That resulted in a dozen missing header files, which I obtained from
https://cmusphinx.github.io/doc/pocketsphinx
Compile errors stated "unknown file name 'ps_mgau_t'" amd also 'acmod_t'
Here is a condensed error report:
ms_mgau.h:92:5: error: unknown type name ‘ps_mgau_t’
ms_mgau.h:105:1: error: unknown type name ‘ps_mgau_t’;
ms_mgau.h:105:25: error: unknown type name ‘acmod_t’;
ms_mgau.h:106:19: error: unknown type name ‘ps_mgau_t’;
ms_mgau.h:107:31: error: unknown type name ‘ps_mgau_t’;
ms_mgau.h:114:30: error: unknown type name ‘ps_mgau_t’;
acmod_t appears to be defined in line 202 of https://cmusphinx.github.io/doc/pocketsphinx/acmod_8h_source.html
Here is the source file for ms_mgau.h https://cmusphinx.github.io/doc/pocketsphinx/ms__mgau_8h_source.html
Should 'ps_mgau_t' reat 'ms_mgau_t'?
It doesn't. It just computes the header path and pass them to compiler.
You can run:
pkg-config --cflags --libs pocketsphinx sphinxbase
To see what it outputs.
You can't do that, you need the header path from pkg-config. You can substitute the pkg-config result yourself though.