在 c 中使用 pocketsphinx
Using pocketsphinx in c
我正在尝试用 c 语言在 ubuntu 上安装和使用 pocketsphinx,但我一直收到此错误
/Desktop/Programming/C/Tests$ gcc libraries.c -o libraries
libraries.c:2:26: fatal error: pocketsphinx.h: No such file or directory
#include <pocketsphinx.h>
^
compilation terminated.
我已经按照安装 sphinxbase 和找到的 pocketsphinx 所需的步骤进行操作 here 但是每次编译我的代码时我都会收到错误。我错过了什么吗?
你是怎么安装pocketsphinx的? "installing" 是什么意思
要使用库,您首先需要将 header 放在编译器可以找到它们的位置(对于 GCC,例如通过使用 -I 选项),然后您需要安装库,以便您的编译器可以反对它。
从错误来看你没有指定库的header文件给你的编译器
您可以手动添加
首先转到包含文件夹
$ cd /usr/include
然后手动添加pocketsphinx.h
$ sudo ln -s /my/path/to/pocketsphinx.h
那么当你想包含pocketsphinx.h文件时,你可以使用:
#include <pocketsphinx.h>
我正在尝试用 c 语言在 ubuntu 上安装和使用 pocketsphinx,但我一直收到此错误
/Desktop/Programming/C/Tests$ gcc libraries.c -o libraries
libraries.c:2:26: fatal error: pocketsphinx.h: No such file or directory
#include <pocketsphinx.h>
^
compilation terminated.
我已经按照安装 sphinxbase 和找到的 pocketsphinx 所需的步骤进行操作 here 但是每次编译我的代码时我都会收到错误。我错过了什么吗?
你是怎么安装pocketsphinx的? "installing" 是什么意思 要使用库,您首先需要将 header 放在编译器可以找到它们的位置(对于 GCC,例如通过使用 -I 选项),然后您需要安装库,以便您的编译器可以反对它。 从错误来看你没有指定库的header文件给你的编译器
您可以手动添加 首先转到包含文件夹
$ cd /usr/include
然后手动添加pocketsphinx.h
$ sudo ln -s /my/path/to/pocketsphinx.h
那么当你想包含pocketsphinx.h文件时,你可以使用:
#include <pocketsphinx.h>