2
votes

I've knowledge of C++ and compiling small plug-ins (always based on a similar and laid out workflow). Though currently I need to compile the latest version of FFTW into a static library (or get it from the compiled version which should supposedly be a lot easier) and it's giving me an insanely hard time. Probably because I don't know the ins and outs of compiling. As a note I'm working on Windows with Visual Studio.

Since I really want to know how this should work I'm asking the question here.

Basically I need a static .lib of fftw3f library on Windows that I can include in another Visual Studio project.

The first I did was download the 64 bit dll's of FFTW from the website (hoping I could use this). http://www.fftw.org/install/windows.html

Then I've done the accompanying step they stated, that is: Run the following in lib.exe.

 lib /def:libfftw3-3.def
 lib /def:libfftw3f-3.def
 lib /def:libfftw3l-3.def

I've done this as well and got a .lib file that I could use in my project correctly. I've been able to compile my project, yet the output build apparently dynamically linked to the library instead of including it as a static library.

I'm compiling my project to .dll but require the fftw3f library to be statically included in my output.

Using lib.exe /list libfftw3f-3.lib I was able to find out that the lib file was referencing the libfftw3f-3.dll.

According to my google results this would mean the .lib file that I created is a DLL import library instead of static library.

It's hard to figure out how to phrase my question because I'm not sure what the terminology is and what's going on behind the scenes. I guess:

  • How can I use the libfftw3f-3.lib file created from lib.exe as a static library in my own project. So that it is included in my output .dll instead of dynamically linked?

Based on what I learn from comments/answers I'll be happy to update/edit/rephrase my question to make more sense for most other users as I'm likely way of with the terminology

1
Did you figure out how to statically link FFTW?Tobi Akinyemi

1 Answers

2
votes

You cannot expect to convert a DLL into a static library.

In order to create a static library you need to re-compile the library from its source code, with an output target that is a static library. If you cannot obtain the source code, then your goal cannot be achieved.