I got GSL to work using CygWin as described here, but I’d like to produce an executable using MinGW. I downloaded GnuWin32, and I got rid of a few errors by putting the contents of GnuWin32\include into MinGW\include, and doing the same for the lib and bin directories, but I’m still getting the error,
undefined reference to 'gsl_sf_bessel_J0'
The code I’m trying to run is,
#include <gsl\gsl_sf_bessel.h>
#include <stdio.h>
int main(void)
{
double x = 5.0 ;
double y = gsl_sf_bessel_J0( x ) ;
printf( "J0(%g) = %.18e\n", x, y ) ;
return 0 ;
}
I learned from here that the linker produced this error message, but I’m not sure what do with this information. I imagine that I need to add some things to compilation command, but I’m not sure what to add. Right now I’m trying to compile using the command,
g++ gsltest.cpp -o gsltest.exe
Any help would be greatly appreciated, thanks!
Geez, Louise. I figured it out. Use,
More information can be found using this powerpoint on scientific programming.