Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.

problem with dfort.lib

sieur_blabla
Beginner
2,624 Views
Hi,

I'm asking your help because I am having a strange error message when I try to build a program using visual studio 2008. This message is:

Erreur 1 fatal error LNK1181: impossible d'ouvrir le fichier en entre 'dfor.lib' LINK

It's in french, but the translation of this message would be:

error 1 fatal error link 1181: cannot open the the file dfor.lib

I never used dfor.lib in my source files, it does not even exist on my computer. I checked many times my files, there's no reason I'd need this lib to build my program.

Please, I really need help, I don't understabnd this error message.

Thanks.
0 Kudos
1 Solution
Jugoslav_Dujic
Valued Contributor II
2,624 Views
You do not want CVF, most likely.

Dfor.lib is the "default" (run-time) library which comes with CVF; no CVF-compiled program could work without it. Intel Fortran has its own run-time libraries, named libifcore*.lib, and those will probably get in conflict with dfor.lib even if you get one.

However, compiled .obj and .lib files may contain references to libraries they want. When linker finds such reference, it wants to pull in the referenced library, and complains when it fails.

Your problem is that, among your sources and libraries, there is an old .lib, probably from a third party, compiled with CVF, which references dfor.lib. You did not tell us so far which one it is.

The .lib files are not compatible among compilers, sorry. You cannot take a .lib file and just magically fix it: you have to ask the vendor for a newer version, or get its sources so that you can recompile it yourself. You cannot have both dfor.lib and libifcore*.lib mixed in the same project, so it wouldn't do you any good even if we provide you with one.

View solution in original post

13 Replies
anthonyrichards
New Contributor III
2,624 Views
It is Compaq Visual Fortran library.
Have you used CVF in the past?
Are you using IVF now?
Is your IVF project a project converted from a CVF project?
Have you tried a Clean build?
0 Kudos
sieur_blabla
Beginner
2,624 Views
First, thanks for your answer. And to answer your questions:
1) I never used CVF before.
2) Yes, now I am using IVF and as an IDE Visual Studio 2008.
3) My project isn't aproject converted from a CVF project and I tried a clean build but that doesn't change anything.

I've just read on the troubleshooting page of this site that I have to re-compile the CVF libraries. Is this really the only solution? If it's the case, please howto do this?
0 Kudos
Lorri_M_Intel
Employee
2,624 Views
You don't need to recompile the CVF libraries, you need to recompile any libraries that were built with CVF.

One (or maybe more) of the libraries that you are linking against in your project, were built with CVF. It may be something that you are using from a colleague, it may be a third-party application. But, something you are linking against, had been built with CVF.

So, the best thing to do right now is to look at what libraries you are linking against.

- Lorri
0 Kudos
sieur_blabla
Beginner
2,624 Views
So, if I unederstood well, it would be better if I recompile the libraries I used in this program?

When I try to open a .lib file with visual studio in order to compile it, a .txt file opens with illisable characters and no possibility to compile. Please, how can I compile this kind of files?
0 Kudos
mecej4
Honored Contributor III
2,624 Views
Think of a library as a coordinated collection of .obj files. Often, a library is produced by concatenating .OBJ files and adding a dictionary/index. In Unix, such a (static) library is called an archive, and is given the suffix .a .

To build a library from sources, you compile the sources (.for or .f or .f90) using the Fortran (and, possibly, C) compiler, and use the librarian (LIB.EXE) to build the library from the object files.

If you use libraries other than those that came with CVF, and you do not have sources, you will have to (i) obtain the CVF runtime redistributables (available from HP) and (ii) compile your sources in Compaq compatibility mode or add compiler directives so that the custom library routines are called with STDCALL linkage.

You need to read the relevant chapters of the Intel Fortran User's Guide.
0 Kudos
sieur_blabla
Beginner
2,624 Views
Thank you very much for your help. I think I understand what I have to do know.
0 Kudos
sieur_blabla
Beginner
2,624 Views
Just one more question please. Is it normal that the file dfor.lib doesn't exist on my computer??
0 Kudos
TimP
Honored Contributor III
2,624 Views
I don't think there was a dfort.lib. You must mean dfor.lib or dfport.lib In ifort, the functionality of dfport.lib is replaced by ifport. Such functions should be declared by USE IFPORT, whether or not they were declared by equivalent CVF/DVF methods. Objects which depend on dfor or dfport should be rebuilt.
As mentioned by a later post, these .lib files would be present only in an installation of the CVF compiler.
0 Kudos
Steven_L_Intel1
Employee
2,624 Views
Tim, that's not correct. dfor.lib is the equivalent of libifcore.lib - it provides the "core" Fortran language support. You are thinking of dfport.lib.
0 Kudos
mecej4
Honored Contributor III
2,624 Views
"Is it normal that the file dfor.lib doesn't exist on my computer?"

Quite so. If you had never had Compaq/Digital Fortran installed on your system, or any other application that used the CVF runtime (e.g. Matlab), there is no reason why dfor.lib should be on your system. It is certainly not distributed with Windows.

In fact, dfor.lib has less chance of being found on a randomly chosen Windows PC than does dfor.dll.
0 Kudos
sieur_blabla
Beginner
2,624 Views
Yeah sorry, I was meaning dfor.lib (I was tired and thinking fortran :p)

So I have no other options than installing a CVF compiler?? I just installed Intel Visual Fortran, how dfor.lib can be not provided with it?? Very strange!!
0 Kudos
Jugoslav_Dujic
Valued Contributor II
2,625 Views
You do not want CVF, most likely.

Dfor.lib is the "default" (run-time) library which comes with CVF; no CVF-compiled program could work without it. Intel Fortran has its own run-time libraries, named libifcore*.lib, and those will probably get in conflict with dfor.lib even if you get one.

However, compiled .obj and .lib files may contain references to libraries they want. When linker finds such reference, it wants to pull in the referenced library, and complains when it fails.

Your problem is that, among your sources and libraries, there is an old .lib, probably from a third party, compiled with CVF, which references dfor.lib. You did not tell us so far which one it is.

The .lib files are not compatible among compilers, sorry. You cannot take a .lib file and just magically fix it: you have to ask the vendor for a newer version, or get its sources so that you can recompile it yourself. You cannot have both dfor.lib and libifcore*.lib mixed in the same project, so it wouldn't do you any good even if we provide you with one.
sieur_blabla
Beginner
2,624 Views
Ok thank you for this clear explanation :)
0 Kudos
Reply