help-gsl
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Help-gsl] Linking error using fft complex radix2 forward


From: John Provis
Subject: Re: [Help-gsl] Linking error using fft complex radix2 forward
Date: Tue, 23 Dec 2003 08:14:02 +1100

James,

I am one of the previous users who's has (seemingly unending) trouble linking to GSL in MSVC++. Eventually, I've figured out a way to get around most of the problems - do you have the "Demo" workspace and project files (demo.dsp and demo.dsw) from the GSL installation? Rather than starting a new project from scratch, copy these files to the folder you want your new project in, and edit the dependencies to include your new source code file - the project and workspace files should already have the required settings that will let it link properly, rather than having to set everything up yourself every time you want to start a new project. You may also have to copy a couple of the .dll files into your project directory - it'll probably give you a runtime error the first time you try to run the program telling you which ones you need.

Have fun...

John.



At 15:58 22/12/2003, you wrote:
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

___________________________________________________________
John Provis                                            address@hidden
Geopolymer and Minerals Processing Group
Department of Chemical and Biomolecular Engineering
University of Melbourne                           Tel. +61 3 8344 8755
Victoria 3010                                            Mob. +61 402 596 209
AUSTRALIA


reply via email to

[Prev in Thread] Current Thread [Next in Thread]