答案1
我找到了源代码dspcat.c
:http://www.smart.net/~rlhamil/。具体在这方面压缩包。我尝试编译它,但缺少一个变量:
$ make
cc -O -DSOLARIS dspcat.c -o dspcat
dspcat.c: In function ‘format_msg’:
dspcat.c:11:23: error: ‘NL_TEXTMAX’ undeclared (first use in this function)
static char result[NL_TEXTMAX*2+1];
^
dspcat.c:11:23: note: each undeclared identifier is reported only once for each function it appears in
dspcat.c: In function ‘print_file’:
dspcat.c:240:23: error: ‘NL_SETMAX’ undeclared (first use in this function)
int setlo=1, sethi=NL_SETMAX, msglo=1, msghi=NL_MSGMAX, x, y;
^
dspcat.c:240:49: error: ‘NL_MSGMAX’ undeclared (first use in this function)
int setlo=1, sethi=NL_SETMAX, msglo=1, msghi=NL_MSGMAX, x, y;
^
dspcat.c: In function ‘main’:
dspcat.c:338:30: error: ‘NL_MSGMAX’ undeclared (first use in this function)
if (msg_nr<1 || msg_nr>NL_MSGMAX) {
^
dspcat.c:353:32: error: ‘NL_SETMAX’ undeclared (first use in this function)
if (msg_set<1 || msg_set>NL_SETMAX) {
^
make: *** [dspcat] Error 1
该变量NL_SETMAX
似乎没有在我的系统上定义。我确实找到了这个头文件,bits/xopen_lim.h
它确实有这个变量,所以我一时兴起将其添加到头文件列表中。
$ make
cc -O -DSOLARIS dspcat.c -o dspcat
dspcat.c: In function ‘format_msg’:
dspcat.c:11:33: warning: integer overflow in expression [-Woverflow]
static char result[NL_TEXTMAX*2+1];
^
dspcat.c:11:16: error: size of array ‘result’ is negative
static char result[NL_TEXTMAX*2+1];
^
dspcat.c:11:16: error: storage size of ‘result’ isn’t constant
dspcat.c:15:29: warning: integer overflow in expression [-Woverflow]
for (x=0; x < (NL_TEXTMAX*2) && *s != '\0'; s++)
^
make: *** [dspcat] Error 1
如果我有更多时间,我会尝试这个,但我相信,如果您直接在代码中静态设置该变量,您也许可以自己编译它。