How to make FFTW ++ work with windows? (for Dummies)

I use Windows 10 and Visual Studio 2015. In C ++, I need to get the Fourier transform of an image to apply filters to it. FFTW ++ seems to be the perfect solution for this, but I can't compile it, and it drives me crazy. I'm relatively new to programming, so I don't know how confusing this is.

I used the NuGet function in Visual Studio to get the FFTW library. Since I could not find it on NuGet, I downloaded the FFTW + material at the following link: https://sourceforge.net/projects/fftwpp/ I copied the contents of the download into the project folder and included the header files in the solution explorer. But he did not compile, threw many, many strange errors (for example: in seconds .h he said that some function that receives the time zone is outdated, and in fftww ++. H it was said that std :: max is illegal).

So, seeing that this did not work, I returned to the FFTW website and tried using the Windows installation guide. http://www.fftw.org/install/windows.html I downloaded the 64-bit version, and I absolutely do not know how to do this, for example, how to import a library or even what it does. i.imgur.com/Qs7mFQT.png That's all I get, I completely lost.

How do I assemble it? If you can: write me the most detailed explanation how to use this thing, I can be dumb, but I donโ€™t know what is happening, and I canโ€™t find any tutorial, for example, on Google.

+4
source share
2 answers

64- FFTW 3.3.5 Windows DLL

( .lib)

  • FFTW .
  • , DLL Visual Studio ++, MSDN DLL, .
  • README-WINDOWS.
  • Visual Studio

    • โ†’ โ†’ Visual Studio 2015 โ†’
    • C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\Tools\VsDevCmd.bat
  • unzip

    lib /machine:x64 /def:libfftw3-3.def

Create .lib file

( libfftw3f-3.def libfftw3l-3.def)

  • libfftw3-3.lib
  • , x64.

Visual Studio ++

  • ++ New Visual Studio C ++ Console Application
  • Save default settings
  • x64 x64 platform

Visual Studio, FFTW.

( this SO .)

, .

  • . Project properties
  • include. . Additional directories

(, .h Visual Studio.)

Visual Studio, FFTW.

  • . Project properties
  • . . Additional Library Directories
  • . .lib, (libfftw3-3.lib). Additional dependency

( FFTW.)

#include "stdafx.h"

#include <fftw3.h>

int main()
{
    fftw_complex *in, *out;
    fftw_plan p;

    int N = 32;

    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);

    return 0;
}

Compile

Windows, FFTW DLL - DLL FFTW (libfftw3-3.dll) Visual Studio.

  • Visual Studio Exporer. Solution in file explorer
  • .exe(, fftw_helloworld2\x64\Debug) Exe output folder
  • DLL libfftw3-3.dll

/

  • F5 Start debugger
+6

, , . :

x86 arch. 32- dll FFTW. , /machine: x86 lib VS2017

Ed

0

Source: https://habr.com/ru/post/1655689/


All Articles