先前帖子中有关安装GSL和编译的说明(从DevKit运行的mingw)
wget ftp.gnu.org/gnu/gsl/gsl-1.15.tar.gz
tar xf gsl*
cd gsl*
./configure
# Warning, make takes about 7 min.
make
make install
在make
期间,一切似乎都运行到了一个点然后发生了编译错误$ make
/usr/Bin/make all-recursive
make[1]: Entering directory `/c/cygwin/home/Seamus/gsl-1.15'
Making all in gsl
make[2]: Entering directory `/c/cygwin/home/Seamus/gsl-1.15/gsl'
rm -f gsl*.h
HEADERLIST="../gsl*.h ../*/gsl*.h"; \
for h in $HEADERLIST; do \
BASENAME=`basename $h`; \
test -r $BASENAME || ln -s $h $BASENAME; \
done
make[2]: Leaving directory `/c/cygwin/home/Seamus/gsl-1.15/gsl'
Making all in utils
make[2]: Entering directory `/c/cygwin/home/Seamus/gsl-1.15/utils'
/bin/sh ../libtool --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -I. -I.. -g -O2 -MT placeholder.lo -MD -MP -MF .deps/placeholder.Tpo -c -o placeholder.lo p laceholder.c
libtool: compile: gcc -DHAVE_CONFIG_H -I. -I.. -g -O2 -MT placeholder.lo -MD -M P -MF .deps/placeholder.Tpo -c placeholder.c -DDLL_EXPORT -DPIC -o .libs/placeh older.o
libtool: compile: gcc -DHAVE_CONFIG_H -I. -I.. -g -O2 -MT placeholder.lo -MD -M P -MF .deps/placeholder.Tpo -c placeholder.c -o placeholder.o >/dev/null 2>&1
mv -f .deps/placeholder.Tpo .deps/placeholder.Plo
/bin/sh ../libtool --tag=CC --mode=link gcc -g -O2 -o libutils.la placehol der.lo -lm
libtool: link: ar cru .libs/libutils.a .libs/placeholder.o
libtool: link: ranlib .libs/libutils.a
libtool: link: ( cd ".libs" && rm -f "libutils.la" && ln -s "../libutils.la" "li butils.la" )
make[2]: Leaving directory `/c/cygwin/home/Seamus/gsl-1.15/utils'
Making all in sys
make[2]: Entering directory `/c/cygwin/home/Seamus/gsl-1.15/sys'
/bin/sh ../libtool --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -I. -I.. -I.. -g -O2 -MT minmax.lo -MD -MP -MF .deps/minmax.Tpo -c -o minmax.lo minmax.c
libtool: compile: gcc -DHAVE_CONFIG_H -I. -I.. -I.. -g -O2 -MT minmax.lo -MD -M P -MF .deps/minmax.Tpo -c minmax.c -DDLL_EXPORT -DPIC -o .libs/minmax.o
In file included from minmax.c:26:0:
../gsl/gsl_minmax.h:1:1: error: expected identifier or '(' before '!' token
../gsl/gsl_minmax.h:1:1: error: stray '\377' in program
../gsl/gsl_minmax.h:1:1: error: stray '\376' in program
../gsl/gsl_minmax.h:1:14: warning: null character(s) ignored
../gsl/gsl_minmax.h:1:16: warning: null character(s) ignored
../gsl/gsl_minmax.h:1:18: warning: null character(s) ignored
../gsl/gsl_minmax.h:1:20: warning: null character(s) ignored
../gsl/gsl_minmax.h:1:22: warning: null character(s) ignored
../gsl/gsl_minmax.h:1:24: warning: null character(s) ignored
../gsl/gsl_minmax.h:1:26: warning: null character(s) ignored
../gsl/gsl_minmax.h:1:28: warning: null character(s) ignored
../gsl/gsl_minmax.h:1:30: warning: null character(s) ignored
../gsl/gsl_minmax.h:1:32: warning: null character(s) ignored
../gsl/gsl_minmax.h:1:34: warning: null character(s) ignored
../gsl/gsl_minmax.h:1:36: warning: null character(s) ignored
../gsl/gsl_minmax.h:1:38: warning: null character(s) ignored
../gsl/gsl_minmax.h:1:40: warning: null character(s) ignored
../gsl/gsl_minmax.h:1:42: warning: null character(s) ignored
make[2]: *** [minmax.lo] Error 1
make[2]: Leaving directory `/c/cygwin/home/Seamus/gsl-1.15/sys'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/c/cygwin/home/Seamus/gsl-1.15'
make: *** [all] Error 2
任何想法都将不胜感激
答案 0 :(得分:1)
使用来自http://www.mingw.org/wiki/Getting_Started的全新安装的新MinGW和MSYS从头开始重新安装(由于第一次通过似乎只下载但实际上没有安装,所以花了一些时间来玩)。添加了窗口环境的路径,如页面所述(对于MSYS和MinGW)。然后启动shell打开一个Windows CMD并运行C:\ MinGW \ msys \ 1.0 \ msys.bat文件。
然后按照详细的说明(忽略Dev-C ++ IDE等等......用于Windows并专注于GSL和MinGW编译)从http://www.ph.utexas.edu/~daneel/GSL_devcpp.html下载,安装和编译GSL库(感谢daneel @ utexas.edu) - 编译或构建时没有问题。
答案 1 :(得分:0)
我为STM32目标交叉编译GSL遇到了同样的问题。我在Windows 7中使用cygwin并修复了问题我强迫cygwin使用本机符号链接导出变量CYGWIN = winsymlinks:nativestrict