Menu

How to use Package in Dev C++

2005-03-22
2012-09-26
  • Nobody/Anonymous

    I downloaded the package FFTW (Fast Fourier Transform) and installed it.
    After installed, I dont know how to use it at all.
    As following in documentation of FFTW, at first, I have to include "fftw3.h"
    The code looks like this:

    include <fftw3.h>

     {
         fftw_complex *in, *out;
         fftw_plan p;
    
         in = fftw_malloc(sizeof(fftw_complex) * N);
         out = fftw_malloc(sizeof(fftw_complex) * N);
         p = fftw_plan_dft_1d(N, in, out, FFTW_FORWARD, FFTW_ESTIMATE);
    
         fftw_execute(p); /* repeat as needed */
    
         fftw_destroy_plan(p);
         fftw_free(in); fftw_free(out);
     }
    

    But I get the error msg, "fftw3.h" cannot be found.

    I couldn't find this file.
    Is there anyone who know to use Package, Package manager ?

    Thankx in advance.

     
    • Marek Januszewski

      someone emailed me a question like that some time ago, I never had time to answer.
      My devpak is for fftw2, your program is looking for version 3, this is not going to work

       
    • Anonymous

      Anonymous - 2005-03-22

      This is what I just did:

      Tools->Check for updates/packages

      Select depacks.org, Check for updates

      Select FFTW 3.0.1 from the list

      Download selected

      Searched my hard drive to discover where the libraries and headers had been installed. Found header in: C:\Dev-Cpp\include\fftw. This is not a default include folder you will need to add it to the projects includes. The library/DLL were placed in C:\Dev-Cpp\lib (which is teh default), and the documentation (HTML and PDF) was in C:\Dev-Cpp\docs\fftw\html

      Created a nes Console Application project.

      Took your code, made it valid (the first elipsis in the documentation must be replaced with something! And the value N defined. The code is incomplete, it also generated invalid conversion errors when compiled as C++).

      Under Project->Project options->Directories->Include directories, I added the FFTW include path.
      Under Project->Project options->parameters->Linker I added C:/Dev-Cpp/lib/fftw3.lib by browsing (had ot add full path for some reason).

      The code compiled an linked.

      The code I used was as below. It probably means nothing, I just hacked the code fragment until it compiled, without reference to meaning. It is after all a code fragment, not a working example. I'd guess you need ot read the documentation to do something useful.

      include <fftw3.h>

      int main()
      {
      fftw_complex in, out;
      fftw_plan p;
      int N = 20 ;

      in = (fftw_complex)fftw_malloc(sizeof(fftw_complex) * N);
      out = (fftw_complex
      )fftw_malloc(sizeof(fftw_complex) * N);
      p = fftw_plan_dft_1d(N, in, out, FFTW_FORWARD, FFTW_ESTIMATE);

      fftw_execute(p); / repeat as needed /

      fftw_destroy_plan(p);
      fftw_free(in); fftw_free(out);
      }

      Hope that helps,

      Clifford

       

Log in to post a comment.

MongoDB Logo MongoDB