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

Issue with DFOR.lib

bsi
Beginner
812 Views

Dear Sir,

We have just switched compilers. We had been using the COMPAQ fortran compiler, and we are now using the Intel fortran compiler. We used the converter that Intel provided to make this switch. For debugging purposes, we have a created a fortran project. We have also created a libray version based on the samefortran files that this debugging project uses. We also have a C prjoject that calls this library. The library (.lib) compiles without error. However, the debugging version does NOT compile properly (there are compile errors). The C project also does not compile without errors. We believe the C project and the debugging version both share the same error.

Specifically, when we compile the C project, we get the following 3 errors:

dfor.lib(for_m_qqs.obj) : error LNK2019: unresolved external symbol _errno referenced in function _flush_nonadv_buffers

dfor.lib(for_portlib.obj) : error LNK2001: unresolved external symbol _errno

fatal error LNK1120: 1 unresolved externals

any help would be greatly appreciated. Thank you.

Petros

0 Kudos
4 Replies
Intel_C_Intel
Employee
812 Views
There should be no references to dfor.lib in your new project. The usual cause of this problem is not recompiling all the Fortran code with the Intel compiler. Do Build..Clean of the project and then a Rebuild and see if these link errors (they are not compiler errors) go away. If not, check the Linker Input property page to see if you named dfor.lib as an additional input.
0 Kudos
bsi
Beginner
812 Views

Steve,

Thanks for the quick response. We are impressed. We have done as you suggested: we have removedALL references to dfor.lib from our project (the linker Input page and the include statements). We now get the following link error when building the fortran project (debugging purposes).

Error1 error LNK2005: ___lookuptable already defined in LIBCMT.lib(output.obj)

Error2 error LNK2005: ___wnullstring already defined in LIBCMT.lib(output.obj)FB-MultiPier

Error3 error LNK2005: ___nullstring already defined in LIBCMT.lib(output.obj)FB-MultiPier

Error5 fatal error LNK1169: one or more multiply defined symbols foundFB-MultiPier

(there is NO error 4)

When building our C project that is using our .lib (fortran files compile with no error), we get the following errors:

Error10fatal error LNK1104: cannot open file 'dfor.lib'

Again, we very much appreciate your help.

0 Kudos
Intel_C_Intel
Employee
812 Views
What exactly did you remove from include statements? dfor.lib would not be referenced there. Do not confuse this with "USE DFLIB" which is ok to leave in.

Your first project would seem to be a combination of Fortran and C. You have what we call "Mixed C Library Syndrome" which is caused by having Fortran code and C code which are compiled with different settings for which run-time libraries are to be used.

From the error messages, you use C code that was compiled with the /MT option (static, multithreaded). For the Fortran project, right click on the project, select Properties, Fortran, Libraries and change "Use Run-Time Libraries" to "Multithreaded".

As for the other problem, either your C project still has a reference in its project properties to dfor.lib or your Fortran library still has CVF-compiled code in it. A simple thing to do is to open your Fortran .lib in Notepad and search for "dfor.lib". Most of what you see is binary, but it will find that string if it was put there by CVF. If no references are found, check the C project properties. You could open the .vcproj file in Notepad and search that too. I don't recommend making edits that way, but it will at least give you a clue as to where to look.
0 Kudos
bsi
Beginner
812 Views

Steve,

You asked "What exactly did you remove from include statements? dfor.lib would not be referenced there. Do not confuse this with "USE DFLIB" which is ok to leave in." This is NOT an issue actually. We tried adding #include dfor.lib in a couple places originally, thinking that we had referenced this library somewhere without including it, but this was not the case.So, we simply commented these include statements back out.

As for the search for dfor.lib in out project, we have done what suggested. We have checked for all references to dfor.lib in out project. There are NONE. (we transferred the text into notepad and did searches on the dfor string)

Also, our fortran project has indeed been compile as "Multithreaded", as you suggested.

Any more thoughts? Thank you again.

Petros

0 Kudos
Reply