C语言 signal和esig_asc错误发生时,在WSL上安装HTK



我正在windows机器上的WSL上安装HTK。.configure运行正确,但当我输入make all时,它不能工作。

错误代码:

(cd HTKLib && make HTKLib.a) 
|| case "" in *k*) fail=yes;; *) exit 1;; esac;
make[1]: Entering directory '/mnt/c/Users/ts4016/AppData/Local/HTK-3.4/htk/HTKLib'
gcc  -ansi -D_SVID_SOURCE -DOSS_AUDIO -D'ARCH="x86_64"' -Wall -Wno-switch -g -O2 -I.  -UPHNALG  -c -o esig_asc.o esig_asc.c
In file included from /usr/include/x86_64-linux-gnu/bits/libc-header-start.h:33,
from /usr/include/stdio.h:27,
from esignal.h:97,
from esig_asc.c:85:
/usr/include/features.h:187:3: warning: #warning "_BSD_SOURCE and _SVID_SOURCE are deprecated, use _DEFAULT_SOURCE" [-Wcpp]
187 | # warning "_BSD_SOURCE and _SVID_SOURCE are deprecated, use _DEFAULT_SOURCE"
|   ^~~~~~~
In file included from esig_asc.c:85:
esignal.h:895:16: error: expected ‘)’ before ‘>=’ token
esignal.h:895:52: error: expected ‘)’ before ‘?’ token
......
In file included from esig_asc.c:88:
esig_asc.c: In function ‘ReadAsciiName’:
esig_asc.c:2641:19: error: ‘_ISalnum’ undeclared (first use in this function)
2641 |                {
|                   ^
esig_asc.c:2641:19: note: each undeclared identifier is reported only once for each function it appears in
esig_asc.c:2746:14: error: ‘_ISalpha’ undeclared (first use in this function)
2746 |  * If annotate != NULL, add annotations in "[]" for readability.
|              ^~~~~~~
esig_asc.c: In function ‘ReadAsciiType’:
esig_asc.c:2944:37: error: ‘_ISupper’ undeclared (first use in this function); did you mean ‘_toupper’?
2944 | static int
|                                     ^
esig_asc.c: In function ‘ReadAsciiMisc’:
esig_asc.c:3310:36: error: ‘_ISlower’ undeclared (first use in this function); did you mean ‘_tolower’?
esig_asc.c: In function ‘ReadAsciiString’:
esig_asc.c:3601:26: error: ‘_ISprint’ undeclared (first use in this function)
esig_asc.c: In function ‘ReadAsciiAxisNames’:
esig_asc.c:3844:14: error: ‘_ISalpha’ undeclared (first use in this function)
esig_asc.c:3925:24: error: ‘_ISalnum’ undeclared (first use in this function)
esig_asc.c: In function ‘AsciiRead’:
esig_asc.c:5509:34: error: ‘_ISprint’ undeclared (first use in this function)
esig_asc.c: In function ‘ReadAsciiEscape’:
esig_asc.c:5890:18: error: ‘_ISxdigit’ undeclared (first use in this function); did you mean ‘isxdigit’?
esig_asc.c:5908:20: error: ‘_ISdigit’ undeclared (first use in this function)
esig_asc.c: In function ‘ReadAsciiNewline’:
esig_asc.c:6148:14: error: ‘_ISspace’ undeclared (first use in this function)
esig_asc.c: In function ‘SkipSpace’:
esig_asc.c:6232:14: error: ‘_ISspace’ undeclared (first use in this function)
esig_asc.c: In function ‘SkipComment’:
esig_asc.c:6310:14: error: ‘_ISgraph’ undeclared (first use in this function)
esig_asc.c:6313:16: error: ‘_ISspace’ undeclared (first use in this function)
esig_asc.c: In function ‘ReadSpace’:
esig_asc.c:6451:9: error: ‘_ISspace’ undeclared (first use in this function)
esig_asc.c: In function ‘WriteAsciiString’:
esig_asc.c:8887:17: error: ‘_ISprint’ undeclared (first use in this function)
esig_asc.c: In function ‘AsciiWriteChar’:
esig_asc.c:9100:17: error: ‘_ISprint’ undeclared (first use in this function)
esig_asc.c:9148:42: error: ‘_ISxdigit’ undeclared (first use in this function); did you mean ‘isxdigit’?
esig_asc.c: In function ‘AsciiWriteWchar’:
esig_asc.c:9361:43: error: ‘_ISprint’ undeclared (first use in this function)
esig_asc.c:9400:51: error: ‘_ISxdigit’ undeclared (first use in this function); did you mean ‘isxdigit’?
esig_asc.c: In function ‘ReadAsciiEscape’:
esig_asc.c:6073:10: warning: ignoring return value of ‘fscanf’, declared with attribute warn_unused_result [-Wunused-result]
make[1]: *** [<builtin>: esig_asc.o] Error 1
make[1]: Leaving directory '/mnt/c/Users/ts4016/AppData/Local/HTK-3.4/htk/HTKLib'
make: *** [Makefile:96: HTKLib/HTKLib.a] Error 1

我将cofigure文件编辑为-m64,这是在windows 10机器上使用WSL时。

我不确定这是从哪里来的,或者这可能是信号的兼容性问题。我无法解决它,也没有任何类似的问题在github或堆栈溢出。请帮助。

我也遇到过同样的问题。在HTKLib/esignal.h文件前面插入#include<ctype.h>行后,上述错误就消失了。

除了这个错误,我还需要在编译器失败的一些宏定义中删除一些空白行。值得一提的是,命令sed -i -e 's/r$// file被多次用于删除配置文件和所有生成的makefile的虚假CR字符,遵循这个问Ubuntu问题。

最新更新