gpt4 book ai didi

在函数 ‘ptmr_start’ 和 ‘ptmr_stop’ 中安装 Sphinxbase 时出现编译错误

转载 作者:行者123 更新时间:2023-11-30 14:55:54 25 4
gpt4 key购买 nike

我正在使用发行版 ( https://sourceforge.net/projects/cmusphinx/files/sphinxbase/5prealpha/ ) 中的 Sphinxbase 和 Pocketsphinx,在安装时出现以下错误:

/sphinxbase/src/libsphinxbase/util/profile.c: In function ‘ptmr_start’:
/sphinxbase/src/libsphinxbase/util/profile.c:185:19: error: storage size of ‘start’ isn’t known
struct rusage start; /* CPU time */
^
/sphinxbase/src/libsphinxbase/util/profile.c:188:15: error: ‘RUSAGE_SELF’ undeclared (first use in this function)
getrusage(RUSAGE_SELF, &start);
^
/sphinxbase/src/libsphinxbase/util/profile.c:188:15: note: each undeclared identifier is reported only once for each function it appears in
/sphinxbase/src/libsphinxbase/util/profile.c: In function ‘ptmr_stop’:
/sphinxbase/src/libsphinxbase/util/profile.c:224:19: error: storage size of ‘stop’ isn’t known
struct rusage stop; /* CPU time */
^
/sphinxbase/src/libsphinxbase/util/profile.c:227:15: error: ‘RUSAGE_SELF’ undeclared (first use in this function)
getrusage(RUSAGE_SELF, &stop);
^

我使用的是 Ubuntu,它在 Macintosh(也是 Unix)上编译得很好。

最佳答案

谢谢@TomKuschel 提供的链接。该链接提供了提示。事实证明这是错误的系统标志,因此未包含文件。包括<sys/time.h><sys/resource.h>解决了问题。

关于在函数 ‘ptmr_start’ 和 ‘ptmr_stop’ 中安装 Sphinxbase 时出现编译错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/45224196/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com