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

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

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!

19 posts / 0 new
Last post
For more complete information about compiler optimizations, see our Optimization Notice.
Steve - Intel Developer Support

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

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

Note that in your case you will want IFORT_COMPILER14 there.

Steve - Intel Developer Support

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

Attachments: 

AttachmentSize
Downloadimage/png errors_1.png112.72 KB
Downloadimage/png Libpath_0.png320.36 KB

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

Attachments: 

AttachmentSize
Downloadimage/png errors_1.png112.72 KB
Downloadimage/png Libpath_0.png320.36 KB

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?

Steve - Intel Developer Support

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.

Attachments: 

AttachmentSize
Downloadimage/png errors2_0.png673.03 KB

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

Type:

set ifort

What does it show?

Steve - Intel Developer Support

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.

 

 

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.

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.

Steve - Intel Developer Support

 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.

Attachment

Attachments: 

AttachmentSize
Downloadimage/png softwares.png1.34 MB

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.

Steve - Intel Developer Support

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?

 

 

 

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.)

Steve - Intel Developer Support

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.

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.

Steve - Intel Developer Support

Leave a Comment

Please sign in to add a comment. Not a member? Join today