Visual Studio 中的 fftw?
我正在尝试将我的项目与 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
。
我已经复制了教程程序,我得到的确切错误是:
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)
那么,我的项目设置可能有什么问题?谢谢!
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\include
and the .dll to 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!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
我的案例
在 Visual Studio 2010 中使用
FFTW
预编译 FFTW 3.3。 1 在我的 Windows XP 计算机上使用 fftw-3.2.1-dll.zip 安装 Windows DLL。
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
文件。关闭项目并再次打开并再次重建。
My case
Using
FFTW
in Visual Studio 2010Precompiled FFTW 3.3.1 Windows DLLs install using fftw-3.2.1-dll.zip, on my Windows XP machine.
cmd
window and go tolib.exe
folderC:\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
ormspdb100.dll
file to in bin directory.You will get 6 files
and copy it to programming directory.
Delete all
mspdb80.dll
ormspdb100.dll
file from bin directory.Closed Project and open again and rebuild it again.
您是否真正链接到您正在构建的项目中的库?
您需要将库的文件名添加到该字段。
Have you actually linked against the library in the project you're building?
You need to add the library's filename to that field.
假设您实际上已将项目链接到 lib 并且它不起作用,请使用
/verbose:lib
并粘贴该项目的输出和Assuming you've actually linked your project against the lib and it doesn't work, use
/verbose:lib
and paste the output of that and the output of我有类似的问题。有用的是使用此帮助编译 fftw 库 在 Visual studio 中编译 FFTW 源 。实际上,更接近的问题是编译我的应用程序 Win 32 并尝试使用 x64 库。因此请确保平台相同。
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.