- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello,
I am trying to use the fftw libray under windows. I got a bunch of files libfftw3-3.def and libfftw3-3.dll. How do I compile my code so that it will link to this libraries? Thanks in advance.
The command: >ifort /libs:dll OneD.f libfftw3-3.def libfftw3-3.dll
gives error:
unrecognized surce type libfftw3-3.dll
libfftw3-3.dll : fatal error LNK1107: invalid or corrupt file:
Best regards,
Cristian
I am trying to use the fftw libray under windows. I got a bunch of files libfftw3-3.def and libfftw3-3.dll. How do I compile my code so that it will link to this libraries? Thanks in advance.
The command: >ifort /libs:dll OneD.f libfftw3-3.def libfftw3-3.dll
gives error:
unrecognized surce type libfftw3-3.dll
libfftw3-3.dll : fatal error LNK1107: invalid or corrupt file:
Best regards,
Cristian
Link Copied
11 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
A .dll is not something you can link to. Usually what you link against is the "export library" (a .lib) that is created as a side-effect of building the DLL. The .def file can be an alternative, so try just leaving the .dll off of the command line and see if that helps.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I tried all the possible combiantions with .dll or/and .def in the compiling command but it does not work.
What about the visual tools? If I make a project, can I specifiy there to link to my library?
Cristian
What about the visual tools? If I make a project, can I specifiy there to link to my library?
Cristian
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
If you can't get it to work from the command line, you won't do better in Visual Studio.
Where did you get this fftw library? Does it include a .lib?
Where did you get this fftw library? Does it include a .lib?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Quoting - Steve Lionel (Intel)
If you can't get it to work from the command line, you won't do better in Visual Studio.
Where did you get this fftw library? Does it include a .lib?
Where did you get this fftw library? Does it include a .lib?
I downloaded from http://fftw.org/install/windows.html. It contains only .def and .dll files. Th installation manual says:
You should be able to call them from any compiler. In order to link to these .dll files from Visual C++, you need to
create .lib "import libraries" for them, and can do so with the "lib" command that comes with VC++. In particular, run:
lib /machine:i386 /def:libfftw3-3.def
lib /machine:i386 /def:libfftw3f-3.def
lib /machine:i386 /def:libfftw3l-3.def
Unfortunately when I execute lib from the command line I get error file not found.
Cristian
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Use Start > All Programs > Intel Software Development Tools > Intel Fortran Compiler x.x > Build Environment for applications on IA-32. This will give you a command environment that will define "lib". Make sure you have set default (cd) to the folder containing the .def file.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Quoting - Steve Lionel (Intel)
Use Start > All Programs > Intel Software Development Tools > Intel Fortran Compiler x.x > Build Environment for applications on IA-32. This will give you a command environment that will define "lib". Make sure you have set default (cd) to the folder containing the .def file.
Thank you for your instructions. It did something.
D:fftw-3.2-dll>lib /machine:i386 /def
Microsoft Library Manager Version
Copyright (C) Microsoft Corporation.
Creating library libfftw3-3.lib and and object libfftw3f-3.exp
Now what do I do to compile my codes?
Cristian
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Add the .lib to your ifort line that links the application.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Quoting - Steve Lionel (Intel)
Add the .lib to your ifort line that links the application.
I appologize, but could you give me an example of how should I compile the code if it has the dependencies in an external libray?
Cristian
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ifort yourcode.f90 extlib.lib
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Quoting - Steve Lionel (Intel)
A .dll is not something you can link to. Usually what you link against is the "export library" (a .lib) that is created as a side-effect of building the DLL. The .def file can be an alternative, so try just leaving the .dll off of the command line and see if that helps.
It would be nice if the compiler driver would invoke LIB automagically when it sees a .def file on its linker command line...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Quoting - Jugoslav Dujic
Quoting - Steve Lionel (Intel)
A .dll is not something you can link to. Usually what you link against is the "export library" (a .lib) that is created as a side-effect of building the DLL. The .def file can be an alternative, so try just leaving the .dll off of the command line and see if that helps.
It would be nice if the compiler driver would invoke LIB automagically when it sees a .def file on its linker command line...

Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page