我在64位操作系統上使用Visual Studio 2012。我試圖在程序中使用FFTW,但是在獲取庫鏈接時遇到問題。Visual Studio 2012中的FFTW鏈接
我從FFTW Windows頁面下載了64位軟件包。我按照這些步驟:
lib /machine:x64 /def:libfftw3-3.def
lib /machine:x64 /def:libfftw3f-3.def
lib /machine:x64 /def:libfftw3l-3.def
這創造了.EXP和.lib文件。
我加入了路徑的所有文件中:
Properties -> Debugging -> Environment Properties -> VC++ Directories -> Include Directories Properties -> C/C++ -> General -> Additional Include Directories Properties -> Linker -> General -> Additional Library Directories
我加.lib文件到屬性 - >鏈接器 - >輸入 - >附加依賴
我添加以下行我的代碼的頂部:
#define FFTW_DLL
#include <fftw3.h>
然後我把示例代碼從FFTW教程到我的代碼,如下所示:
fftw_complex *in;
fftw_complex *out;
fftw_plan p;
in = (fftw_complex*) fftw_malloc(sizeof(fftw_complex)*L);
out = (fftw_complex*) fftw_malloc(sizeof(fftw_complex)*L);
p = fftw_plan_dft_1d(L, in, out,FFTW_FORWARD,FFTW_MEASURE);
fftw_execute(p);
fftw_destroy_plan(p);
fftw_free(in);
fftw_free(out);
當我再嘗試建立我的申請,我得到以下錯誤:
Error 1 error LNK2019: unresolved external symbol __imp__fftw_execute referenced in function _wmain C:\EEG_Hardware\source\dspApp\ConsoleApplication1\ConsoleApplication1\ConsoleApplication1.obj 1 1 ConsoleApplication1
Error 2 error LNK2019: unresolved external symbol __imp__fftw_plan_dft_1d referenced in function _wmain C:\EEG_Hardware\source\dspApp\ConsoleApplication1\ConsoleApplication1\ConsoleApplication1.obj 1 1 ConsoleApplication1
Error 3 error LNK2019: unresolved external symbol __imp__fftw_destroy_plan referenced in function _wmain C:\EEG_Hardware\source\dspApp\ConsoleApplication1\ConsoleApplication1\ConsoleApplication1.obj 1 1 ConsoleApplication1
Error 4 error LNK2019: unresolved external symbol __imp__fftw_malloc referenced in function _wmain C:\EEG_Hardware\source\dspApp\ConsoleApplication1\ConsoleApplication1\ConsoleApplication1.obj 1 1 ConsoleApplication1
Error 5 error LNK2019: unresolved external symbol __imp__fftw_free referenced in function _wmain C:\EEG_Hardware\source\dspApp\ConsoleApplication1\ConsoleApplication1\ConsoleApplication1.obj 1 1 ConsoleApplication1
Error 6 error LNK1120: 5 unresolved externals C:\EEG_Hardware\source\dspApp\ConsoleApplication1\Debug\ConsoleApplication1.exe ConsoleApplication1
我已經通過這個網站進行搜索,嘗試任何解決方案,我可以找到,但至今沒有運氣。任何援助將不勝感激!