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

howto to call IVF8 static library from VS.c++NET

guido_lombardi
Beginner
1,200 Views
As I did with VS C++ 6 and digital visual fortran 5, I have added the .lib fortran taic library to a C++ project using IVF8and VS.c++NET.
It does not work and I got the following error.
Deleting intermediate files and output files for project 'usoCisortstatic', configuration 'Debug|Win32'.

Compiling...

main.cpp

Linking...

isortstatic.lib(isort.obj) : error LNK2019: unresolved external symbol _for_emit_diagnostic referenced in function _ISORT

Debug/usoCisortstatic.exe : fatal error LNK1120: 1 unresolved externals

I have read in IVF8 User guide that <> Thus, it is not possible to link static IVF8 library in VS C++ .NET project?

I have used this calling extern "C" void ISORT(int * ia, int * n, int * iperm);

Onlydll version is working fine.

thank you, Guido

0 Kudos
8 Replies
Steven_L_Intel1
Employee
1,200 Views
In IVF, the default when building a static library project is to not insert into the object code linker directives that name the Fortran libraries to be used - this is done to prevent problems when these libraries are used with varying project types. So you will have to name the libraries explicitly - libifcore.lib is the one you want - I don't think you'll need others.
The easiest way to handle this is to add libifcore.lib (find it in Program FilesIntelFortrancompiler80ia32lib) to your C++ project files. An alternative is to name it in the "additional modules" list in the Linker project properties - if you don't give the full path, you will have to add the path to the Fortran libraries under Tools..Options..Projects..C++ Directories..Library Files.

Message Edited by sblionel on 05-18-2004 09:18 AM

0 Kudos
guido_lombardi
Beginner
1,200 Views

Thank you for your comment.

I have just tried to insert in Properties->Linker->Additional Library directory the path "C:ProgrammiIntelFortrancompiler80IA32LIB".

But the compiler 's answer is the same:

isortstatic.lib(isort.obj) : error LNK2019: unresolved external symbol _for_emit_diagnostic referenced in function _ISORT

Debug/usoCisortstatic.exe : fatal error LNK1120: 1 unresolved externals

I have tried to add libfcore.lib but now the answer is:

LINK : fatal error LNK1104: cannot open file 'libirc.lib'

Then I added tis last lib but I gotmany errors such:

Linking...

libifcore.lib(for_get.obj) : error LNK2019: unresolved external symbol __qw32used referenced in function _for__get_su

libifcore.lib(for_exit.obj) : error LNK2001: unresolved external symbol __qw32used

libifcore.lib(for_close_proc.obj) : error LNK2019: unresolved external symbol __qw32used referenced in function _for__close_proc

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

For checking my problems I attach the projects: static fortran lib, use of static fortran link from fortran (OK), use of static fortran lib from c++.

Thank you again,

Guido

Message Edited by guido.lombardi@polito.it on 05-18-2004 06:42 AM

0 Kudos
Steven_L_Intel1
Employee
1,200 Views

Ok, let's try it this way.

In the Fortran project, right click on the project, select Properties, Fortran, Libraries. Change "Disable default library Search Rules" to "No".

In Tools..Options..Projects..VC++ Directories..Library Files, add the path to the Fortran IA32LIB folder I mentioned above.

Rebuild the Fortran project and then the C project.

0 Kudos
guido_lombardi
Beginner
1,200 Views

Thank you very much for the solution! I 'd like to ask you few details on this operation.

In Tools..Options..Projects..VC++ Directories..Library Files, add the path to the Fortran IA32LIB folder I mentioned above.

This is a "permanent" modification to VS.net envaironment because it is a project's option: Is this additctional path influencing the normal functionalities of VS.NET?

Thank you again,

Guido

0 Kudos
Steven_L_Intel1
Employee
1,200 Views
The Tools..Options change is harmless to VC++ - it simply makes the Intel Fortran libraries visible to projects that need it.
0 Kudos
guido_lombardi
Beginner
1,200 Views

Final question:

why does it fail to insert in project property Properties->Linker->Additional Library the directory "C:ProgrammiIntelFortrancompiler80IA32LIB" instead of Tools..Options..Projects..VC++ Directories..Library Files?

Is this a VS.NET bug?

thank you again for your useful support,

Guido

0 Kudos
Steven_L_Intel1
Employee
1,200 Views
I'm not sure what the "it" refers to here. The Intel Fortran install isn't allowed to modify the VC++ settings. I do feel we could improve the documentation in this area, as it is more complex than it was under CVF.
0 Kudos
guido_lombardi
Beginner
1,200 Views

Greatidea! New details on the user guide will be very useful,

bye,

Guido

0 Kudos
Reply