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

fatal error LNK1104: can not open “dfor.lib”

Peng_G_1
Beginner
1,029 Views

 

I have a FORTRAN language project which I am trying to build it with the port 3 library. I get the following error.

LINK : fatal error LNK1104: cannot open file "dfor.lib"

Microsoft Visual Studio 2012,Intel(R) Visual Fortran 2013, and windiows 7

0 Kudos
10 Replies
Lorri_M_Intel
Employee
1,029 Views

dfor.lib is the Fortran runtime library that was provided with CVF.

It seems that at least one of your objects or libraries was built with CVF, and was not re-built with Intel Fortran.

You *might* be able to get away with simply adding /nodefaultlib:dfor.lib to the link line.   However, that might provoke other undefined symbols, just to warn you.

           --Lorri

0 Kudos
Steven_L_Intel1
Employee
1,029 Views

Even if you don't get link errors, I very strongly recommend instead that you recompile all Fortran sources (including those in libraries or objects) with Intel Fortran, as otherwise you may get unexpected behavior.

0 Kudos
mecej4
Honored Contributor III
1,029 Views

If the Port-3 library was built with CVF, the routines in the library will have STDCALL linkage, which is not compatible with the default linkage conventions of Intel Fortran.

0 Kudos
Peng_G_1
Beginner
1,029 Views

mecej4 wrote:

If the Port-3 library was built with CVF, the routines in the library will have STDCALL linkage, which is not compatible with the default linkage conventions of Intel Fortran.

How to resolve this problem?

0 Kudos
Peng_G_1
Beginner
1,029 Views

Steve Lionel (Intel) wrote:

Even if you don't get link errors, I very strongly recommend instead that you recompile all Fortran sources (including those in libraries or objects) with Intel Fortran, as otherwise you may get unexpected behavior.

Thanks for your help. How to  recompile all Fortran sources (including those in libraries or objects) with Intel Fortran? I rebuild all the program but the problem is still there.

0 Kudos
Peng_G_1
Beginner
1,029 Views

Lorri Menard (Intel) wrote:

dfor.lib is the Fortran runtime library that was provided with CVF.

It seems that at least one of your objects or libraries was built with CVF, and was not re-built with Intel Fortran.

You *might* be able to get away with simply adding /nodefaultlib:dfor.lib to the link line.   However, that might provoke other undefined symbols, just to warn you.

           --Lorri

Thanks for your reply. Lorri

Yes, the port 3 library was built with CVF, and was not re-built with Intel Fortran. So where can I found the link line and simply adding  /nodefaultlib:dfor.lib.

 

0 Kudos
Steven_L_Intel1
Employee
1,029 Views

You are going to have to rebuild the "port 3" library or get a version that was built with Intel Visual Fortran.  While you MIGHT be able to eliminate link errors with /ignorelib, it will almost certainly lead to unexpected run-time behavior.

If you really want to try this, set the project property Linker > Input > Ignore Specific Library to dfor.lib  But don't get your hopes up.

0 Kudos
Peng_G_1
Beginner
1,029 Views

Steve Lionel (Intel) wrote:

You are going to have to rebuild the "port 3" library or get a version that was built with Intel Visual Fortran.  While you MIGHT be able to eliminate link errors with /ignorelib, it will almost certainly lead to unexpected run-time behavior.

If you really want to try this, set the project property Linker > Input > Ignore Specific Library to dfor.lib  But don't get your hopes up.

Thanks, Steve.

Yes, eliminate link errors can not get my hopes, there are many other library link errors.

I did not get a version port 3 that was built with Intel Visual Fortran, So I have to rebuild it. Could you please tell how to rebuilt  a CVF "port 3" library with  Intel Visual Fortran. Thanks very much.

0 Kudos
mecej4
Honored Contributor III
1,029 Views

Do you have the sources for the Port library, or at least the portions of the library that your program uses? If not, you may need to rework your program to use a more modern set of libraries such as MKL. Portions of Port are available at http://www.netlib.org/port/ , but not all portions of Port are available there. Those non-public portions had to be obtained by request from Bell Labs, but that was decades ago, and the old Bell Labs is gone for ever.

0 Kudos
Peng_G_1
Beginner
1,029 Views

mecej4 wrote:

Do you have the sources for the Port library, or at least the portions of the library that your program uses? If not, you may need to rework your program to use a more modern set of libraries such as MKL. Portions of Port are available at http://www.netlib.org/port/ , but not all portions of Port are available there. Those non-public portions had to be obtained by request from Bell Labs, but that was decades ago, and the old Bell Labs is gone for ever.

Thanks for your reply. It will be very useful to me.

0 Kudos
Reply