【发布时间】:2017-10-19 17:20:55
【问题描述】:
我正在尝试使用dieharder 来测试随机序列的质量。为了在windows上编译,我安装了msys和gsl开发。 GSL 编译没有任何问题。为了编译 Dieharder,我首先运行 ./configure
然后当我在 msys 中输入make 时,它返回以下错误消息:
(cd libdieharder; \make)
make[1]: Entering directory `/f/dieharder-3.31.1/libdieharder'
/bin/sh ../libtool --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -I. -I.. -DVERSION=3.31.1 -DLITTLE_ENDIAN=1 -I ../include -I /usr/local/include -std=c99 -Wall -pedantic -g -O2 -MT libdieharder_la-dab_dct.lo -MD -MP -MF .deps/libdieharder_la-dab_dct.Tpo -c -o libdieharder_la-dab_dct.lo `test -f 'dab_dct.c' || echo './'`dab_dct.c
libtool: compile: gcc -DHAVE_CONFIG_H -I. -I.. -DVERSION=3.31.1 -DLITTLE_ENDIAN=1 -I ../include -I /usr/local/include -std=c99 -Wall -pedantic -g -O2 -MT libdieharder_la-dab_dct.lo -MD -MP -MF .deps/libdieharder_la-dab_dct.Tpo -c dab_dct.c -DDLL_EXPORT -DPIC -o .libs/libdieharder_la-dab_dct.o
make[1]: Leaving directory `/f/dieharder-3.31.1/libdieharder'
错误信息是:
dab_dct.c: In function 'fDCT2':
dab_dct.c:251:44: error: 'M_PI' undeclared (first use in this function)
output[i] += (double) input[j] * cos((M_PI / len) * (0.5 + j) * i);
^~~~
dab_dct.c:251:44: note: each undeclared identifier is reported only once for each function it appears in
dab_dct.c: In function 'iDCT2':
dab_dct.c:274:30: error: 'M_PI' undeclared (first use in this function)
sum += input[j] * cos(((M_PI * j) / len) * (0.5 + i));
^~~~
dab_dct.c: In function 'evalMostExtreme':
dab_dct.c:289:15: warning: variable 'pos' set but not used [-Wunused-but-set-variable]
unsigned int pos = 0;
^~~
make[1]: *** [libdieharder_la-dab_dct.lo] Error 1
make[1]: Leaving directory `/f/dieharder-3.31.1/libdieharder'
make: *** [libwulf.time] Error 2
我的问题是我应该在文件开头声明M_PI还是在安装过程中出错?
【问题讨论】:
-
@KenWhite,对不起,你是对的。我已添加错误消息。