On Sunday 15 January 2006 04:59 pm, Michael J D'Amato wrote:
> OK, I'm so frustrated I'm about to hang myself from the tree in my front
> yard. I've been trying to set up gsl for 3 days to no avial! I'm trying
> to compile the example bessel program in the manual and I keep getting
> "undefined reference to bessel.....". Has anyone sucessfully setup gsl
> with MinGw/Msys. I downloaded gsl from the gnuwin32 website so I believe I
> don't have to build from source (not that I would know how if I had to).
> My situation so far:
>
> -compiler is located here:
> c:\MinGw (it works fine)
>
> -MSYS is located here:
> c:\MSYS (it works fine)
>
> -Files to compile located here:
> c:\myprograms
>
> -gsl located here:
> c:\gnuwin32\include\gsl
>
> I have moved the gsl file everywhere in the compiler search path and used
> the -I option. Any tips would be greatly appreciated as the noose is
> looking like the best way to solve my problems. Anyone replying please
> include detailed steps because I'm an idiot! thanks
It works here on a linux box. Somebody suggested to use a makefile and that
was the best idea. I have it attached. You need to modify it for your setup.
I also include the bessel.cpp that actually compiles and runs.
It's the sample from GSL
>
>
>
> ---------------------------------
> Find your next car at Yahoo! Canada Autos
> _______________________________________________
> Help-gsl mailing list
> [email protected]
> http://lists.gnu.org/mailman/listinfo/help-gsl
--
Best regards
Thomas Spuhler
VP Marketing
TUSONIX, Inc.
All Tusonix outgoing e-mail has been scanned for viruses
GSLLIBS = -L/usr/local/lib -lgsl -lgslcblas
GSLINCS = -I/usr/local/include
# space seperated list of source files in program
SOURCES = bessel.cpp
# change testProgram.exe to the name you wish your
# executable program to be
bessel: $(SOURCES)
g++ -o $@ $(GSLINCS) $(GSLLIBS) $(SOURCES)
/* BESSEL.C: This program illustrates Bessel functions,
* including: _j0 _j1 _jn _y0 _y1 _yn
*/
#include <math.h>
#include <gsl/gsl_sf_bessel.h>
#include <stdio.h>
#include <gsl/gsl_errno.h>
int main()
{
double x = 2.3870;
int n = 3, c;
printf( "Bessel functions for x = %f:\n", x );
printf( " Kind\t\tOrder\tFunction\tResult\n\n" );
printf( " First\t\t0\tgsl_sf_bessel_J0( x )\t%f\n", gsl_sf_bessel_J0( x ) );
printf( " First\t\t1\tgsl_sf_bessel_J1( x )\t%f\n", gsl_sf_bessel_J1( x ) );
for( c = 2; c < 5; c++ )
printf( " First\t\t%d\tgsl_sf_bessel_Jn( n, x )\t%f\n", c, gsl_sf_bessel_Jn( n, x ) );
printf( " Second\t\t0\tgsl_sf_bessel_K0( x )\t\t%f\n", gsl_sf_bessel_K0( x ) );
printf( " Second\t\t1\tgsl_sf_bessel_K1( x )\t\t%f\n", gsl_sf_bessel_K1( x ) );
for( c = 2; c < 5; c++ )
printf( " Second\t\t%d\tgsl_sf_bessel_Yn( n, x )\t%f\n", c, gsl_sf_bessel_Yn( c, x ) );
return(0);
}
_______________________________________________
Help-gsl mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/help-gsl