Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.
Announcements
FPGA community forums and blogs have moved to the Altera Community. Existing Intel Community members can sign in with their current credentials.
29314 Discussions

libifcore.lib calling dfor.lib, which doesn't exist

laura_s_kang
Beginner
929 Views
I'm using visual studio .net 2003 and intel fortran compiler to compile mixed program. My main program is in c, which calls functions in fortran. I created intel fortran static library project for fortran codes, so that it would generate lib file. When I try to compile the whole thing, without adding anything to additional dependencies on C program properties, it generates errors, basically saying, _for_cypstr, _for_emit_diagnostic, and _for_cpstr are missing. Error message is like:

Fortran.lib(name1.obj) : error LNK2019: unresolved external symbol _for_cpystr referenced in function _NAME1

Fortran.lib(name2.obj) : error LNK2019: unresolved external symbol _for_emit_diagnostic referenced in function _NAME2

etc

I read the document "porting applications from compaq visual fortran to intel visual fortran" and added "libifcore.lib" to additional dependencies. It solves the problem above, but created a new one. It seems like libifcore.lib is calling dfor.lib, which I don't have. And even I put a copy of dfor.lib I got from other program, it would still give the same error.
dfor.lib(for_diags.obj) : error LNK2005: _for__issue_diagnostic already defined in libifcore.lib(for_diags_intel.obj)

dfor.lib(for_diags.obj) : error LNK2005: _for__io_return already defined in libifcore.lib(for_diags_intel.obj)

libifcore.lib(for_m_qwin.obj) : error LNK2019: unresolved external symbol __f_outtext referenced in function __fq_outtext

libifcore.lib(for_m_qwin.obj) : error LNK2019: unresolved external symbol __f_gettextposition referenced in function __fq_gettextposition

libifcore.lib(for_m_qwin.obj) : error LNK2019: unresolved external symbol __f_settextposition referenced in function __fq_settextposition

What should I do?

0 Kudos
1 Reply
Steven_L_Intel1
Employee
929 Views
Laura,

If you have references to dfor.lib, either you are linking in code that was compiled with CVF, or you have an explicit reference to dfor.lib in your project options.

What I suggest you do is this. Remove the libifcore.lib from your options. In the Fortran library project, open the project properties, select Fortran..Libraries and change the value of "Disable default library search rules" from "Yes" to "No". For static library projects, Yes is the default so that you can properly link the library with other Fortran code, but it does pose a problem when you link with non-Fortran code.

Now rebuild the solution. If you still see any references to dfor.lib, make sure that you are not still using any CVF-compiled objects or libraries.
0 Kudos
Reply