使用FFTWLib(C#):找不到libfftw3-3.dll [英] Using FFTWLib (C#): Cannot find libfftw3-3.dll

查看:621
本文介绍了使用FFTWLib(C#):找不到libfftw3-3.dll的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用Tamas Szalay的 FFTW的C#端口在Visual C#2010中,当我尝试使用FFTW中的函数(在本例中为fftw.malloc)时,出现了以上错误.如果我将dll手动移动到项目的/bin/debug/文件夹中,该错误就会消失,但随后我会得到

I'm trying to use Tamas Szalay's C# port of FFTW in Visual C# 2010, and I'm getting the above error when I try to use a function from FFTW (in this case fftw.malloc). That error goes away if I manually move the dll into the project's /bin/debug/ folder, but then I get

An attempt was made to load a program with an incorrect format.
(Exception from HRESULT: 0x8007000B)
Method: IntPtr malloc(Int32)

这让我觉得我有一个更深层次的问题.

which makes me think I have a deeper problem.

可能是相关的:我正在x64机器上运行它,并且DependencyWalker说fftwlib.dll是为x86构建的.

Possibly relevant: I'm running this on an x64 machine, and DependencyWalker says that fftwlib.dll is built for x86.

推荐答案

如果使用外部32位代码,则必须将项目CPU配置设置为x86,而不是Any CPU.

You got to set your project CPU configuration to x86 instead of Any CPU if you are using external 32 bit code.

任何CPU是Visual Studio的默认配置,如果您在64位OS上运行,则默认情况下它将编译为64位代码,问题是,如果您需要像在这种情况下那样加载32位DLL,则您会出现格式错误.

Any CPU is the default Visual Studio configuration, if you are running on a 64 bit OS, it will by default compile as 64 bit code, the problem is that if you need to load 32 bit DLLs like in your case, you will get format errors.

http://cl.ly/3s1J2q3u3E0n2F2y0z1K <-屏幕快照.

http://cl.ly/3s1J2q3u3E0n2F2y0z1K <-- screenshot where it is located.

这篇关于使用FFTWLib(C#):找不到libfftw3-3.dll的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆