c - GCC/MinGW problems with GSL -
i'm attempting compile c-program using mingw on windows 7. program relies on cblas-library of gsl, in short i'm (trying to) run command in terminal (cmd):
gcc myprogram.c -o myprogram.exe -o3 -lm -lgsl -lgslcblas
this results in long series of error messages of form:
undefined reference '_imp____infinity'
and
undefined reference '_impure_ptr'
from various gsl-functions. i.e.:
/gsl-1.9/specfunc/trig.c:335: undefined reference '_imp____infinity'
which seems relate function overflow_error in gsl.
i compiled gsl source using msys (and prefix'ing configure path mingw), seems me linking gsl-libraries not issue - i.e. functions appears located correctly.
for record, can remove cblas-based parts of program (making program useless) , compile program using:
gcc myprogram.c -o myprogram.exe -o3 -lm
where i've placed appropriate directories in path.
i quite puzzled unexpected error, seems linking gsl messes links fundamental c-libraries? furthermore, program compiles fine on ubuntu 15.04 (with gsl-flags).
you definitely should not incurring references either __infinity
, (which translate dll import reference of _imp____infinity
), or _impure_ptr
, within clean mingw build of gsl. record, downloaded gsl-latest.tar.gz
, unpacked , did, (using linux hosted gcc-4.8.2 mingw32-cross-compiler):
$ mkdir gsl-1.16/build $ cd gsl-1.16/build $ ../configure --build=x86_64-linux-gnu --host=mingw32 --prefix=/mingw ... $ make $ make prefix=`pwd`/staged install
this creates following content in staged/lib
:
$ ls -r staged/lib staged/lib: libgsl.a libgslcblas.a libgslcblas.dll.a libgslcblas.la libgsl.dll.a libgsl.la pkgconfig staged/lib/pkgconfig: gsl.pc
and subsequently running nm
on generated libraries, confirms absence of such references:
$ nm -a staged/lib/*.a | grep infinity $ nm -a staged/lib/*.a | grep impure_ptr
i performed stfw on undefined reference _impure_ptr
, having failed find msdn reference; useful hits cygwin ml thread, suggesting such references generated when user improperly adds cygwin's header path mingw compiler's -i
search path @ build time ... i.e. deliberate contamination of header pool.
Comments
Post a Comment