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 on community.intel.com are migrating to the new Altera Community and are read-only. For urgent support needs during this transition, please visit the FPGA Design Resources page or contact an Altera Authorized Distributor.
29283 Discussions

Cannot open file 'ifconsol.lib' with mixed C++ and fortran code

Lan_L_
Beginner
4,638 Views

Hi, the mixed C++ and Fortran code has this link problem. When I mannually add the path of ifconsol.lib, the error disappears, but other link errors pop up, for example, error LNK2019:unresolved external symbol, which means it cannot link to other files, although we has already setup the linkage of all the files together through  'Project dependences' in the MS Visual Studio. Then after I manually added all the library files in the linker, the code ran well. The software packages I use are MS Visual Studio 2008, Intel Visual Fortran w_fcompxe_2013.3.171, and Intel C++ Composer XE 2013 SP1 w_ccompxe_2013_sp1.1.139. Does anyone know the reasons of those link errors? Thanks!

0 Kudos
18 Replies
Steven_L_Intel1
Employee
4,638 Views
0 Kudos
Lan_L_
Beginner
4,638 Views

I followed the instructions, but the same error (cannot open ifconsol.lib)  came out.

0 Kudos
Steven_L_Intel1
Employee
4,638 Views

Show me a screenshot of the same screen as this one:

Note that in your case you will want IFORT_COMPILER14 there.

0 Kudos
Lan_L_
Beginner
4,638 Views

Yes, I use IFORT_COMPILER14 and same errors come out, see attachments.

0 Kudos
Lan_L_
Beginner
4,638 Views

Yes, I use IFORT_COMPILER14 and same errors come out, see attachments.

0 Kudos
Steven_L_Intel1
Employee
4,638 Views

I see that the first two entries in the libraries list are for older versions of Intel Fortran. Take out those entries. But I see you also have 19 warnings. Can you attach the full build log (it will be a .htm file)? ZIP it first.

Does C:\Program Files (x86)\Intel\Composer XE 2013 SP1\compiler\lib\ia32 exist on your PC? Does it contain those libraries?

0 Kudos
Lan_L_
Beginner
4,638 Views

Because I tried IFORT_COMPILER14 first, it didn't work. You can see the 19th warning in the attachment. Then I found the file ia32.lib in the path C:\Program Files(x86)\Intel\Composer XE 2013 SP1\compiler\lib\, which I thought it should be same as IFORT_COMPILER14. Then I added this path, but it seems still not work.

0 Kudos
Steven_L_Intel1
Employee
4,638 Views

Do this.  Click Start. In the Search box type cmd , When cmd.exe appears, click it.

Type:

set ifort

What does it show?

0 Kudos
Lan_L_
Beginner
4,638 Views

It shows,

IFORT_COMPILER11=C:\Program Files (x86)\Intel\Compiler\11.1\065\

IFORT_COMPILER13=C:\Program Files (x86)\Intel\Composer XE 2013\

I tried IFORT_COMPILER13 before. It didn't work either.

 

 

0 Kudos
Lan_L_
Beginner
4,638 Views

It shows,

C:\Users\lliang>set ifort
IFORT_COMPILER11=C:\Program Files (x86)\Intel\Compiler\11.1\065\
IFORT_COMPILER13=C:\Program Files (x86)\Intel\Composer XE 2013\

I tried IFORT_COMPILER13 before. It didn't work either.

0 Kudos
Steven_L_Intel1
Employee
4,638 Views

It doesn't look as if you have Composer XE 2013 SP1 installed. You may no longer have the previous version installed either.

Does folder C:\Program Files (x86)\Intel\Composer XE 2013 SP1\compiler\lib\ia32 exist on your system?

Another thing to try is a reboot. Sometimes the system environment variables don't update right away.

0 Kudos
Lan_L_
Beginner
4,638 Views

 I installed both Composer XE 2013 SP1 and Composer XE 2013 (see attachment), but the folders \compiler\lib\ia32 in these two composers include different files, for example,  there is no ifconsol.lib in Composer XE 2013 SP1, while it exists in Composer XE 2013.

I rebooted the computer before, no use.

0 Kudos
Lan_L_
Beginner
4,638 Views

Attachment

0 Kudos
Steven_L_Intel1
Employee
4,638 Views

You installed C++ Composer XE, not Fortran Composer XE. Please go back to the Intel Registration Center and download Intel Visual Fortran Composer XE 2013 SP1.

0 Kudos
Lan_L_
Beginner
4,638 Views

Because the code is mixed with C++ and Fortran, my computer was installed both Composer XE 2013 for Fortran and Composer XE 2013 SP1 for C++.  I manually added the following four paths in the linker,

C:\Program Files (x86)\Intel\Composer XE 2013\compiler\lib\ia32          (Fortran)
C:\Program Files (x86)\Intel\Composer XE 2013 SP1\compiler\lib\ia32  (C++)
C:\Program Files (x86)\Intel\Composer XE 2013\mkl\lib\ia32                (Fortran)
C:\Program Files (x86)\Intel\Composer XE 2013 SP1\mkl\lib\ia32         (C++)

and then mannually add all the compiled lib files in the linker->input->additional dependences, the whole package can be built. Actually the code had been linked in the "project dependences" before compiling. It seems Visual Studio(VS) cann't realize its functions. Is that possible VS takes Composer XE 2013 as the old version and automatically replaced it by C++ Composer XE 2013 SP1 as a newer version of Fortran composer?

 

 

 

0 Kudos
Steven_L_Intel1
Employee
4,638 Views

You don't have the SP1 version of Fortran installed, so IFORT_COMPILER13 would be the right choice. That should work. In recent versions of Visual Studio (2010 and later), project dependencies from C++ to Fortran don't work (this is a Microsoft restriction.)

0 Kudos
Lan_L_
Beginner
4,638 Views

Thanks for your comments.I installed Fortran SP1 version. $(IFORT_COMPILER14)compiler\lib\ia32 works if I manually add its related lib folder in the project linker. However, if I add it in Visual Studio 2008->tools->Options->Projects and Solutions->VC++ Directions->Library files, it cann't work.

Also the project dependencies from C++ to Fortran work well with this Fortran SP1 version and Visual Studio 2008.

0 Kudos
Steven_L_Intel1
Employee
4,638 Views

I know it works because I've done it that way for years. I am not sure why it is not working for you, but I'm glad you have a solution. Yes, using project dependencies works in VS2008. It stops working in VS2010.

0 Kudos
Reply