0

so i compiled the GSL from source with Cygwin. Everything went fine, i didnt get any errors. But when i try to compile some simple code, i get the following errors:

..\..\..\Programme\CodeBlocks\MinGW\lib\libgsl.a(error.o) In function `gsl_error':
\usr\include\gsl\err\error.c|43|undefined reference to `__getreent'
\usr\include\gsl\err\error.c|44|undefined reference to `__getreent'
\usr\include\gsl\err\error.c|45|undefined reference to `__getreent'
..\..\..\Programme\CodeBlocks\MinGW\lib\libgsl.a(stream.o) In function `gsl_stream_printf':
\usr\include\gsl\err\stream.c|37|undefined reference to `__getreent'
..\..\..\Programme\CodeBlocks\MinGW\lib\libgsl.a(stream.o) In function `gsl_set_stream':
\usr\include\gsl\err\stream.c|61|undefined reference to `__getreent'

I linked the libgsl.a and libgscblas.a libraries, and there are no complains about any other functions.

For future reference: Dont press cancel instead of Ok when you want to set up a toolchain in code::blocks

user1290204
  • 15
  • 1
  • 5
  • This is an installation problem with cygwin on your system (or with the cmd box you're using to compile). Please share your compile environment and not just the errors. It's neither a programming problem nor an issue with gsl. – Ahmed Masud May 06 '12 at 16:48

2 Answers2

3

The error you're seeing is due to the fact that MinGW doesn't link the Cygwin DLL by default.

MinGW- and Cygwin-compiled libraries don't play that well with each other - while it's possible to get it to work, it's not really a good idea.

Choose one toolchain for your project, which, in this case, means either setting up Code::Blocks so it uses the Cygwin toolchain instead of the bundled MinGW distribution or compiling GSL with MinGW as well.

Christoph
  • 164,997
  • 36
  • 182
  • 240
  • I thought i already tried to use the Cygwin toolchain, but as it turns out, it didnt save my configurations, so it still remained as the MinGW toolchain <_<. Going to try it with out with actually correct toolchain now. – user1290204 May 06 '12 at 17:17
0

You may use the following option in Cygwin:

./configure CC=i686-w64-mingw32-gcc

Then you may use GSL in CodeBlocks.

jokersobak
  • 141
  • 3