我在发布时使用了Sphinxbase和Pocketsphinx(https://sourceforge.net/projects/cmusphinx/files/sphinxbase/5prealpha/),安装时遇到以下错误:
/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。
答案 0 :(得分:1)
感谢@TomKuschel的链接。该链接提供了一个提示。原来这是糟糕的系统标志,因此文件不包括在内。包括<sys/time.h>
和<sys/resource.h>
解决了这个问题。