Red Hat Bugzilla – Bug 248

Is libgsl a bit broken?

Last modified: 2008-05-01 11:37:48 EDT

Is libgsl a bit broken, or is just me? For example if I try to compile this simple program : #include <math.h> #include <gsl_errno.h> #include <gsl_fft_real.h> #include <gsl_fft_halfcomplex.h> void main() { int i, n = 100; double data[n]; gsl_fft_real_wavetable real_wavetable; for (i = 0; i < n; i++) data[i] = 0.0; for (i = n / 3; i < 2 * n / 3; i++) data[i] = 1.0; gsl_fft_real_wavetable_alloc( n, &real_wavetable ); gsl_fft_real_init( n, &real_wavetable ); gsl_fft_real( data, n, &real_wavetable ); gsl_fft_real_wavetable_free( &real_wavetable ); } using : gcc -lgslfft -lgslerr -lm -o fft fft.c The following errors occur : /tmp/cca007241.o: In function `main': /tmp/cca007241.o(.text+0x0): multiple definition of `main' /usr/lib/libgslfft.a(benchmark.o)(.text+0x0): first defined here ld: Warning: size of symbol `main' changed from 1056 to 481 in /tmp/cca007241.o /tmp/cca007241.o: In function `main': /tmp/cca007241.o(.text+0x121): undefined reference to `gsl_fft_real_wavetable_alloc' /tmp/cca007241.o(.text+0x134): undefined reference to `gsl_fft_real_init' /tmp/cca007241.o(.text+0x14d): undefined reference to `gsl_fft_real' /tmp/cca007241.o(.text+0x15c): undefined reference to `gsl_fft_real_wavetable_free'

[Additional information] I downloaded the new gsl library from the gnu site, compiled it up, rewrote the test program to fit the new api, and it failed in exactly the same way. Either they are doing something consistently wrong, or I'm misssing something very obvious. If this is a "your holding your mouth the wrong way" type of thing I'm going to look silly...

[ARRG] No it's me. Where's my gun. gcc -o fft fft.c -lgslfft -lgslerr -lm This works OK. It's where you put the libraries on the command line. I can't believe I've never noticed this before.