我找到了以下源代码dspcat.c
:http : //www.smart.net/~rlhamil/。特别是在这个tarball中。我尝试编译它,但缺少变量:
$ 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
如果我有更多时间可以解决这个问题,但是我相信,如果您直接在代码中静态设置该变量,则可以自己进行编译。
strings
命令足以满足您的需求吗?也许有一点后期处理?