FFTW for C# DLLNotFoundExeption

Hey all, I’m trying to use FFTW for C# in Unity to do some calculations, but every time I try to run a script that calls it I get

DllNotFoundException: libfftw3f-3.dll
FFTTest1.InitFFTW (Int32 n) (at Assets/My Assets/Scripts/FFT/FFTTest1.cs:32)
FFTTest1.Start () (at Assets/My Assets/Scripts/FFT/FFTTest1.cs:26)

I have the libfftw3f-3.dll in my Plugins folder as well as in the Assets folder. I have used external plugins before and they’ve worked fine. I don’t know where to go from here though. I’ve tried looking for a way to get Monodevelop to ‘point’ to the dll files it needs but I’m having trouble finding a solution. Here is the site for FFTW as it normally comes (without the C# port), maybe there’s a better way to do this that I’m just not seeing. Any help or advice is much appreciated!!

Thank you!
~Jake

Are you doing it the right way? First: you must have Pro to use DLLs. Second: you must write a C# script declaring the external functions and place it in Plugins - something like this:

using UnityEngine;
using System.Collections;
using System.Runtime.InteropServices;

public class FFTW : MonoBehaviour {
  [DllImport("libfftw3f-3")]
  public static extern void InitFFTW(int n);
  [DllImport("libfftw3f-3")]
  public static extern void FreeFFTW();
}

This script declares the functions as static, what makes them available to other scripts as FFTW.InitFFTW(n), for instance. But you may have problems: according to some other questions in UA, a DLL library that tries to access other DLLs may not find them.

Just an update for anyone else trying this out. I just started working on my project again and found out that DLL’s being accessed by other DLL’s must be in the root folder (not the Assets/Plugins folder, but the root of the project).