Error using mex, LINK : fatal error LNK1104: cannot open file 'ifconsol.lib'

16 views (last 30 days)
I used mex to build a Fortran timestwo.F with Intel Parallel Studio XE 2017 for Fortran and Microsoft Visual Studio 2017. It generated an error: LINK : fatal error LNK1104: cannot open file 'ifconsol.lib'. I set path to both x64 and x32 ifconsol.lib but it didn't work. What should I do to solve the problem? Thanks.

Answers (2)

Pruthvi Muppavarapu
Pruthvi Muppavarapu on 13 May 2019
Edited: Pruthvi Muppavarapu on 13 May 2019
Hi Tuan,
The above error might be a result of not having the necessary libraries in the library path. Try running the following commands to add the libraries:
>> fortranRoot = getenv( 'IFORT_COMPILER17');
>> mex('timestwo.F', ['-L' fullfile(fortranRoot, 'compiler', 'lib', 'intel64_win') ]);
Regards,
Pruthvi

Alejandro Pedrozo
Alejandro Pedrozo on 21 Jul 2021
Hi, I had this problem working with the mex function, Microsoft Visual Studio 2010, and Intel composer XE 13. I tried to find the missing libraries in the default folder of the compiler(C:\Program Files (x86)\Intel\Composer XE 2013\Compiler\lib), but they were not there. Fortunately, I have Intel composer XE 11 installed on another computer, its library folder had the missing libraries I needed. So, I copied the required ones from one folder to the other to run the example again. I noted that the error changed since the missing libraries were different this time. I iterated this procedure until the code ran successfully. I hope this information helps you!

Categories

Find more on Fortran with MATLAB in Help Center and File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!