Я использую библиотеку FFTW в VC++ и пытаюсь запустить этот код. Когда я запускаю его, я получаю следующую ошибку
ССЫЛКА: фатальная ошибка LNK1104: невозможно открыть файл «libfftw3l-3.dll»
Я создал файлы dll и lib, как указано на веб-сайте FFTW, и добавил файлы dll в свой проект с помощью Linker > Input > Additional Dep.
#include <fftw3.h>
#include <math.h>
int main(void)
{
fftw_complex *in, *out;
fftw_plan p;
int nx = 5;
int ny = 5;
int i;
float M_PI = 3.14;
/* Allocate the input and output arrays, and create the plan */
in = (fftw_complex*)fftw_malloc(sizeof(fftw_complex) * nx * ny);
out = (fftw_complex*)fftw_malloc(sizeof(fftw_complex) * nx * ny);
p = fftw_plan_dft_2d(nx, ny, in, out, FFTW_FORWARD,
FFTW_ESTIMATE);
/* Now fill the input array with the input data */
/* We'll simply make a sine wave */
for (i = 0; i < (nx * ny); i++) {
in[i][0] = sin(i / 10.0 * M_PI); /* Real part */
in[i][1] = 0.0; /* Imaginary part */
}
/* Actually execute the plan on the input data */
fftw_execute(p);
/* Print out the results */
for (i = 0; i < (nx * ny); i++)
printf("Coefficient %d: %f%+f*i\n", i, out[i][0], out[i][1]);
/* Clean up after ourselves */
fftw_destroy_plan(p);
fftw_free(in); fftw_free(out);
return 0;
}
libfftw3l
это дляlong double
версии FFTW - зачем это вообще в вашем проекте??? - person Paul R   schedule 14.08.2012libfftw3
DLL, но неlibfftw3l
илиlibfftw3f
DLL. - person Paul R   schedule 14.08.2012