windows - Compiling GSL library using MSYS and using it with MinGW (nuwen) -


i'm trying build newest version of gsl library windows, able use mingw distro nuwen.net (for one, it's bundled boost, , want that). unfortunately, gsl relies on configure script, figured need msys2.

using

./configure --prefix=/gsl/gsl-2.4-build --host=i686-w64-mingw32 --build=i686-w64-mingw32 --target=i686-w64-mingw32 make -j 4 make install 

i able compile gsl under msys2 (it took long time). wasn't sure on host, build , target options, understand msys use different gcc (g++ (gcc) 6.3.0) , nuwen distro built using same stuff above options (?). anyway, wanted sure resulting libs can used under mingw on windows (i.e. not depending on msys2 anymore).

now when trying compile , link simplest gsl program using nuwen mingw distro (g++ (gcc) 7.1.0, get:

test_gsl_boost>mingw32-make compiling main.cpp... g++ -c main.cpp -o main.o -wall -o3 -i"c:\mingw\include" -i"d:\gsl\gsl-2.4-build\include" linking main... g++  main.o -o main.exe -l"d:\gsl\gsl-2.4-build\lib" -lgsl -lgslcblas -lm -lboost_thread -lboost_system -static d:\gsl\gsl-2.4-build\lib\libgsl.a(error.o): in function `gsl_error': /gsl/gsl-2.4/err/error.c:43: undefined reference `__getreent' /gsl/gsl-2.4/err/error.c:44: undefined reference `__getreent' /gsl/gsl-2.4/err/error.c:45: undefined reference `__getreent' d:\gsl\gsl-2.4-build\lib\libgsl.a(stream.o): in function `gsl_stream_printf': /gsl/gsl-2.4/err/stream.c:37: undefined reference `__getreent' d:\gsl\gsl-2.4-build\lib\libgsl.a(stream.o): in function `gsl_set_stream': /gsl/gsl-2.4/err/stream.c:61: undefined reference `__getreent' collect2.exe: error: ld returned 1 exit status mingw32-make: *** [makefile:19: main] error 1 

(boost libraries here can removed, want able use boost later) seems i'm stuck , feel don't understand important here. doing wrong?

edit: code want compile:

#include <iostream> #include <boost/format.hpp> #include <gsl/gsl_sf_bessel.h>  int main(int argc, char **argv) {     double x = 5.0;     double y = gsl_sf_bessel_j0 (x);     std::cout << boost::format("j0(%g) = %.18e\n") % x % y;      return 0; } 

edit 2

it seems use msys2's mingw-w64 gsl library itself, if wanted compile gsl using gcc, , use resulting library (linking statically) compiler? possible?


Comments

Popular posts from this blog

php - Vagrant up error - Uncaught Reflection Exception: Class DOMDocument does not exist -

vue.js - Create hooks for automated testing -

Add new key value to json node in java -