visual-studio fftw 在 Visual Studio 中?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/2727293/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
fftw in Visual Studio?
提问by Nate Parsons
I'm trying to link my project with fftw and so far, I've gotten it to compile, but not link. As the site said, I generated all the .lib files (even though I'm only using double precision), and copied them to C:\Program Files\Microsoft Visual Studio 9.0\VC\lib, the .h file to C:\Program Files\Microsoft Visual Studio 9.0\VC\includeand the .dll to C:\windows\system32.
我正在尝试将我的项目与 fftw 链接,到目前为止,我已经编译了它,但没有链接。正如该网站所说,我生成了所有 .lib 文件(即使我只使用双精度),并将它们复制到C:\Program Files\Microsoft Visual Studio 9.0\VC\lib.h 文件到C:\Program Files\Microsoft Visual Studio 9.0\VC\include.dll 到C:\windows\system32.
I've copied the tutorial program, and the exact error I am getting is:
我已经复制了教程程序,我得到的确切错误是:
1>hw10.obj : error LNK2019: unresolved external symbol __imp__fftw_free referenced in function "bool __cdecl test(void)" (?test@@YA_NXZ)
1>hw10.obj : error LNK2019: unresolved external symbol __imp__fftw_destroy_plan referenced in function "bool __cdecl test(void)" (?test@@YA_NXZ)
1>hw10.obj : error LNK2019: unresolved external symbol __imp__fftw_execute referenced in function "bool __cdecl test(void)" (?test@@YA_NXZ)
1>hw10.obj : error LNK2019: unresolved external symbol __imp__fftw_plan_dft_1d referenced in function "bool __cdecl test(void)" (?test@@YA_NXZ)
1>hw10.obj : error LNK2019: unresolved external symbol __imp__fftw_malloc referenced in function "bool __cdecl test(void)" (?test@@YA_NXZ)
So, what could be wrong with my project setup? Thanks!
那么,我的项目设置可能有什么问题?谢谢!
采纳答案by Stu Mackellar
Have you actually linked against the library in the project you're building?
您是否真的链接到您正在构建的项目中的库?
Project -> Properties -> Linker -> Input -> Additional dependencies
You need to add the library's filename to that field.
您需要将库的文件名添加到该字段。
回答by Wilson Jin
My case
我的情况
Using FFTWin Visual Studio 2010
使用FFTWVisual Studio 2010中
Precompiled FFTW 3.3.1 Windows DLLs install using fftw-3.2.1-dll.zip, on my Windows XP machine.
在我的 Windows XP 机器上使用 fftw-3.2.1-dll.zip 安装预编译的 FFTW 3.3.1 Windows DLL。
- Open
cmdwindow and go tolib.exefolderC:\Program Files\Microsoft Visual Studio 10.0\VC\bin> - Type
lib /def:libfftw3-3.def - Type
lib /def:libfftw3f-3.def - Type
lib /def:libfftw3l-3.def - If you have a error on command, copy any
mspdb80.dllormspdb100.dllfile to in bin directory. You will get 6 files
libfftw3-3.exp, libfftw3-3.lib, libfftw3f-3.exp, libfftw3f-3.lib, libfftw3l-3.exp and libfftw3l-3.lib
and copy it to programming directory.
Delete all
mspdb80.dllormspdb100.dllfile from bin directory.Closed Project and open again and rebuild it again.
- 打开
cmd窗口并转到lib.exe文件夹C:\Program Files\Microsoft Visual Studio 10.0\VC\bin> - 类型
lib /def:libfftw3-3.def - 类型
lib /def:libfftw3f-3.def - 类型
lib /def:libfftw3l-3.def - 如果您在命令上出错,请将任何
mspdb80.dll或mspdb100.dll文件复制到 bin 目录中。 你会得到6个文件
libfftw3-3.exp、libfftw3-3.lib、libfftw3f-3.exp、libfftw3f-3.lib、libfftw3l-3.exp 和 libfftw3l-3.lib
并将其复制到编程目录。
从 bin 目录中删除所有
mspdb80.dll或mspdb100.dll文件。关闭项目并再次打开并再次重建它。
回答by Alex Budovski
Assuming you've actually linked your project against the lib and it doesn't work, use /verbose:liband paste the output of that and the output of
假设您实际上已将您的项目与 lib 相关联,但它不起作用,请使用/verbose:lib并粘贴该项目的输出以及
dumpbin /exports fftw.lib | findstr fftw_free
回答by tonis
I had similar problem. What helped was compiling the fftw libs with this help Compiling FFTW source in Visual studio. Actually more closely the problem was compiling my application Win 32 and trying to use x64 -libraries. So make sure the platform is same.
我有类似的问题。使用此帮助Compiling FFTW source in Visual Studio 编译 fftw库有帮助。实际上,问题更接近于编译我的应用程序 Win 32 并尝试使用 x64 -libraries。所以确保平台是相同的。

