Dear
Sir/Madam,
I tried to build a simple example that i
obtained from the GNU scientific library
website(http://www.gnu.org/software/gsl/manual/gsl-ref_15.html#SEC239),
using visual c++ (winconsole application). but i encountered a linking
error:
fft1.obj: error lnk2001: unresolved external
symbol _gsl_fft_complex_radix2_forward
Debug/fft.exe: fatal error lnk1120: 1 unresolved externals
Error executing link.exe.
The program code that i have used is shown
below:
//---------------------------------------------------------------------------------
#include <stdio.h>
#include <math.h>
#include <gsl/gsl_errno.h>
#include <gsl/gsl_fft_complex.h>
#define REAL(z,i) ((z)[2*(i)])
#define IMAG(z,i) ((z)[2*(i)+1])
int
Pascal WinMain (HINSTANCE hInstance, HINSTANCE hPrevInstance,LPSTR
IpszCmdLine,int nCmdShow)
{
int i;
double data[2*128];
for (i = 0; i < 128; i++)
{
REAL(data,i) = 0.0;
IMAG(data,i) = 0.0;
}
REAL(data,0) = 1.0;
for (i = 1; i <= 10; i++)
{
REAL(data,i) = REAL(data,128-i) =
1.0;
}
for (i = 0; i < 128; i++)
{
printf ("%d %e %e\n", i,
REAL(data,i), IMAG(data,i));
}
printf ("\n");
gsl_fft_complex_radix2_forward (data, 1, 128);
for (i = 0; i < 128; i++)
{
printf ("%d %e %e\n", i,
REAL(data,i)/sqrt(128),
IMAG(data,i)/sqrt(128));
}
return 0;
}
//---------------------------------------------------------------------------------
Following
advices from other people who encountered linking errors in
gsl(http://sources.redhat.com/ml/gsl-discuss/2003-q2/msg00281.html),
i added a /MD at the end of the list of settings in the
Project-settings-c/c++ window, to no avail.
DO you have any idea how i could resolve this
linking error? Please advise.
With thanks,
James
_______________________________________________
Help-gsl mailing list
address@hidden
http://mail.gnu.org/mailman/listinfo/help-gsl