How to properly link FFTW when compiling?

I am trying to create a spectral processing plugin and I have almost completely installed the FFTW library using the precompiled version and a tutorial from this site. I have made it down to the very last step, but I don’t think I can do it properly. They suggest to load the .dll files into the output directory where the .exe file is located, but I do not have that ability when I am exporting a .vst3 file. The plugin compiles, but when I try to open the plugin in FL Studio, I get an error that the plugin could not load, and to make sure it was installed correctly. I tried loading the .dll files into the vst3 directory where the plugin is created with no luck. Is it possible to compile my plugin so that loading the .dll files somewhere else is unnecessary? If not, where should I move the .dll files so that the plugin loads correctly?

Thanks!

Linking audio plugins (which are DLLs themselves) with other DLLs is a PITA. If you can build a static library version of FFTW, that would be a better solution in the context of a plug-in, but you might have problems with the LGPL license of FFTW in that case, depending on your use case. There are different issues with it on macOS, but it sounds like you are on windows, so here are some windows tips:

If you want to use FFTW as a DLL

You can either

  1. put the DLL in C:\Windows\System32 . This is a horrible solution, since it requires elevated permissions and other software might put their DLL there with the same name
  2. load the DLL at runtime from a specified location with LoadLibrary(). You could use this library to handle that in a cross platform way, helping you get function pointers for all the FFTW functions you need
  3. Investigate adding a path using the win32 APIs, telling the parent process where to find DLLs. I expect you can find more information about that here

God that is a pain haha. I tried compiling FFTW myself but I couldn’t get it to work. When I saw the precompiled version on the website, I thought that would be enough, but apparently there’s a lot more I need to do in order for it to work properly. FFTW doesn’t make this easy, if I still can’t figure it out I’ll try using a different library.

I recently came across the PFFFT library, which can be an alternative to FFTW. PFFFT does 1D Fast Fourier Transforms, real and complex vectors. It tries do it fast, it tries to be correct, and it tries to be small. Computations do take advantage of SSE1 instructions on x86 cpus, Altivec on powerpc cpus, and NEON on ARM cpus. The license is BSD-like, it is compatible with proprietary projects.