Visual Studio 中的 fftw?

发布于 2024-08-30 17:47:38 字数 1072 浏览 4 评论 0原文

我正在尝试将我的项目与 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(4

浪漫之都 2024-09-06 17:47:38

我的案例

在 Visual Studio 2010 中使用 FFTW

预编译 FFTW 3.3。 1 在我的 Windows XP 计算机上使用 fftw-3.2.1-dll.zip 安装 Windows DLL。

  1. 打开 cmd 窗口并转到 lib.exe 文件夹 C:\Program Files\Microsoft Visual Studio 10.0\VC\bin>
  2. 键入 lib /def:libfftw3-3.def
  3. 输入 lib /def:libfftw3f-3.def
  4. 输入 lib /def:libfftw3l-3.def
  5. 如果您有命令错误,请将任何 mspdb80.dllmspdb100.dll 文件复制到 bin 目录中。
  6. 您将获得 6 个文件

    <块引用>

    libfftw3-3.exp, libfftw3-3.lib, libfftw3f-3.exp, libfftw3f-3.lib,
    libfftw3l-3.exp 和 libfftw3l-3.lib

    并将其复制到编程目录。

  7. 从 bin 目录中删除所有 mspdb80.dllmspdb100.dll 文件。

  8. 关闭项目并再次打开并再次重建。

My case

Using FFTW in Visual Studio 2010

Precompiled FFTW 3.3.1 Windows DLLs install using fftw-3.2.1-dll.zip, on my Windows XP machine.

  1. Open cmd window and go to lib.exe folder C:\Program Files\Microsoft Visual Studio 10.0\VC\bin>
  2. Type lib /def:libfftw3-3.def
  3. Type lib /def:libfftw3f-3.def
  4. Type lib /def:libfftw3l-3.def
  5. If you have a error on command, copy any mspdb80.dll or mspdb100.dll file to in bin directory.
  6. 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.

  7. Delete all mspdb80.dll or mspdb100.dll file from bin directory.

  8. Closed Project and open again and rebuild it again.

别闹i 2024-09-06 17:47:38

您是否真正链接到您正在构建的项目中的库?

Project -> Properties -> Linker -> Input -> Additional dependencies

您需要将库的文件名添加到该字段。

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.

千纸鹤 2024-09-06 17:47:38

假设您实际上已将项目链接到 lib 并且它不起作用,请使用 /verbose:lib 并粘贴该项目的输出和

dumpbin /exports fftw.lib | findstr fftw_free

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

dumpbin /exports fftw.lib | findstr fftw_free
独闯女儿国 2024-09-06 17:47:38

我有类似的问题。有用的是使用此帮助编译 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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文