FFTW Library +vs2012 Configuration

Source: Internet
Author: User

Configuration environment: windows7+vs2012


To download the resource bundle, unzip for example to:

In order to embed the VS2012, the corresponding LIB file is needed, then the VS2012 is used to generate the corresponding LIB file.

Find four files in the Vs2012/common7/ide directory such as the following:

Place these four files in the Vs2012/vc/bin directory:

In the CMD operation for example the following:

When the above occurs, it means that lib.exe can perform normally

Enter the following command:

Lib/machine:i386/def:libfftw3-3.def
Lib/machine:i386/def:libfftw3f-3.def
Lib/machine:i386/def:libfftw3l-3.def

The corresponding lib file is generated.

Put the above files into the VS2012 installation directory, Fftw3.h put into the Include directory, the corresponding LIB file into the Lib directory, DLL files into the Windows/system32 directory, configuration is complete.

Next Test FFTW Library:

Create a new project in VS2012:

Include header files such as the following:

#include "stdafx.h" #include "fftw3.h"  #include "iostream" #include <stdio.h> #include <stdlib.h># Include <string.h> #include "opencv.hpp" using namespace cv;using namespace std;

After joining, copy a code such as the following:

void Test2 () {Fftw_complex *in, *out;  Fftw_plan p;  int n= 8;  int i;  Int J;  in = (fftw_complex*) fftw_malloc (sizeof (FFTW_COMPLEX) * N);  out = (fftw_complex*) fftw_malloc (sizeof (FFTW_COMPLEX) * N);  for (i=0; i < N; i++)  {  in[i][0] = 1.0;  IN[I][1] = 0.0;  printf ("%6.2f", In[i][0]);  }  printf ("\ n");  P=FFTW_PLAN_DFT_1D (N,in,out, Fftw_forward, fftw_estimate);  Fftw_execute (P); for (j = 0;j < n;j++)  {  printf ("%6.2f", Out[j][0]);  }  printf ("\ n");  Fftw_destroy_plan (p);  Fftw_free (in);   Fftw_free (out);  System ("Pause");} int main ()  {  test2 (); System ("pause"); return 0;  }  

Test results such as the following:



The FFT operation of the image is tested such as the following:


FFTW Library +vs2012 Configuration

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.