Using FFTW with Visual Studio 2010

  • (2 Pages)
  • +
  • 1
  • 2

21 Replies - 17591 Views - Last Post: 10 July 2012 - 11:12 PM Rate Topic: -----

#16 nullcoding  Icon User is offline

  • D.I.C Head

Reputation: 3
  • View blog
  • Posts: 99
  • Joined: 08-July 12

Re: Using FFTW with Visual Studio 2010

Posted 10 July 2012 - 04:07 PM

Actually I found a setting under Project Properties > Linker > Input > Additional Dependencies

I added the three FFTW library paths and got this:

1>LINK : fatal error LNK1104: cannot open file 'C:\Users\USERNAME\Documents\Visual Studio 2010\Projects\gjsFFTW_TEST_2\dependancies\fftw\lib\libfftw3-3f.lib'



:|
Was This Post Helpful? 0
  • +
  • -

#17 nullcoding  Icon User is offline

  • D.I.C Head

Reputation: 3
  • View blog
  • Posts: 99
  • Joined: 08-July 12

Re: Using FFTW with Visual Studio 2010

Posted 10 July 2012 - 04:15 PM

View Postnullcoding, on 10 July 2012 - 04:07 PM, said:

Actually I found a setting under Project Properties > Linker > Input > Additional Dependencies

I added the three FFTW library paths and got this:

1>LINK : fatal error LNK1104: cannot open file 'C:\Users\USERNAME\Documents\Visual Studio 2010\Projects\gjsFFTW_TEST_2\dependancies\fftw\lib\libfftw3-3f.lib'



:|


I'd typed the file name wrong.

Fixing the spelling error didn't help. Now it's back to the 5 unresolved externals.

I have no idea how to link these 3 libraries or the dll.
Was This Post Helpful? 0
  • +
  • -

#18 Skydiver  Icon User is offline

  • Code herder
  • member icon

Reputation: 5955
  • View blog
  • Posts: 20,408
  • Joined: 05-May 12

Re: Using FFTW with Visual Studio 2010

Posted 10 July 2012 - 04:54 PM

If the linker can't open the file, it typically because the file doesn't exist. Double check you spellings and/or the number of spaces.

The rarer case is if you have anti-virus software that is slow to open or close files.

The documentation for the error also lists other possible reasons for the link error, but for me it's usually a typo in the path or filename.
http://msdn.microsof...s(v=vs.71).aspx
Was This Post Helpful? 0
  • +
  • -

#19 nullcoding  Icon User is offline

  • D.I.C Head

Reputation: 3
  • View blog
  • Posts: 99
  • Joined: 08-July 12

Re: Using FFTW with Visual Studio 2010

Posted 10 July 2012 - 05:13 PM

I should note that even as I get increasingly frustrated, I have managed to link MPIR libraries (a fork of GMP)

This all means nothing unless you love number theory, or at least have some knowledge of the desire to represent huge numbers in C++. I only know that I CAN, but not HOW.

So I at least have one possibility for accomplishing what I want to do.

Still confused / annoyed with FFTW. I am clearly the one doing something wrong, but can't figure it out.
Was This Post Helpful? 0
  • +
  • -

#20 Skydiver  Icon User is offline

  • Code herder
  • member icon

Reputation: 5955
  • View blog
  • Posts: 20,408
  • Joined: 05-May 12

Re: Using FFTW with Visual Studio 2010

Posted 10 July 2012 - 05:47 PM

I join you in your frustration. I downloaded FFTW and created the .lib's as instructed in the README and downloaded the basic usage Tutorial from figueroa.

I'm getting the same linking errors you are when I'm inside VS2010.

But if I go to the commandline and compile using:
cl TryFFTW.cpp -Ifftw /link fftw\libfftw3-3.lib



Everything compiles and links successfully. What The Frak?
Was This Post Helpful? 0
  • +
  • -

#21 #define  Icon User is offline

  • Duke of Err
  • member icon

Reputation: 1853
  • View blog
  • Posts: 6,667
  • Joined: 19-February 09

Re: Using FFTW with Visual Studio 2010

Posted 10 July 2012 - 07:42 PM

This is not an answer, but some points.

The linker cannot find the decorated function name in its list of libs.
The name __imp__fftw_free has the import decoration __imp_ and the cdecl name _fftw_free, I believe. So there are two underscores after __imp.


From : Format of a C Decorated Name

MSDN said:

Note that in a 64-bit environment, functions are not decorated.

Whether that is correct or not - your guess is as good as mine.

Checking names etc :-
How To Create 32-bit Import Libraries Without .OBJs or Source
Was This Post Helpful? 1
  • +
  • -

#22 Skydiver  Icon User is offline

  • Code herder
  • member icon

Reputation: 5955
  • View blog
  • Posts: 20,408
  • Joined: 05-May 12

Re: Using FFTW with Visual Studio 2010

Posted 10 July 2012 - 11:12 PM

#define indirectly lead me to the solution with the not about the linker decorations. The default VS2010 C++ build environment targets Win32 x86 is the root cause.

Since both nullcoding and I were on x64 machines, and we had downloaded the x64 versions of FFTW. Additionally following the instructions in the README files generates x64 import libraries.

Anyway, the solution in to tell VS2010 to build targetting x64...
http://msdn.microsof...ibrary/9yb4317s
Was This Post Helpful? 0
  • +
  • -

  • (2 Pages)
  • +
  • 1
  • 2