- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I'm trying to compile a user subroutine for a commercial software Ansys. I run a .bat script which compiles the user subroutine written in Fortran and creates an Ansys executable. But I'm getting error stating-
LINK : fatal error LNK1104: cannot open file 'ifconsol.lib'
************************************************************************
LINK ERROR
************************************************************************
I run the .bat script from VS 2019 command prompt, and I have 2024 and 2025 intel OneAPI fortran compilers installed and linked.
ifconsol.lib is in "C:\Program Files (x86)\Intel\oneAPI\compiler\2024.2\lib" & "C:\Program Files (x86)\Intel\oneAPI\compiler\2025.0\lib"
In the tabs in VS 2029 Tools>Options>Intel Compilers and Libraries>IFORT Intel Fortran Classic>Compilers I can find the paths for executable, includes, libraries I assume that the above mentioned path is added to them already but I'm not sure, and also there is Win32 and x64 option, the workstation is x64 but the VS 2019 32-bit I guess, I assume x64 is the right one which corresponds to this workstation.
I want to know how to solve this issue, should I add it to the path if it's not added already, but if it's already added how should I tackle this issue.
I'm attaching the pictures of library and include paths which are added already.
Thank you in advance for your assistance!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
When you say "the VS2019 command prompt", do you mean the one under the Visual Studio start menu folder, or the one under Intel oneAPI? You should use the latter, as the former does not reference the Intel libraries. The settings you see inside Visual Studio are not used from the command prompt.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello Steve!
I open the command prompt from Visual Studio Professional 2019 from the tab Tools>Command Line>Developer Command Prompt, and try to compile it using this. It's according to the instructions given by Ansys in their documentation, by running a .bat provided by them it compiles and also creates an executable.
But I do not understand what you meant by "use the latter, as the former does not reference the Intel libraries". And where you referring to settings when you mentioned "under Intel oneAPI"? I'm completely new to this, so please excuse me if I'm not understanding it properly or if I'm not making any proper sense.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks for the details. The Ansys instructions are wrong for Fortran - they would be OK for C/C++.
Do this instead. Click on the Start menu and type "oneAPI" (without the quotes). When you see "Intel oneAPI command prompt for Intel 64 for Visual Studio 2019" (or 2022 if you have that), click that. Set your default directory (cd) to the directory with your source (or another writable directory). Now run the Ansys .bat file.
The Visual Studio command prompt does not honor the Intel Fortran directory settings.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks lot of for your help Steve and Andrew!!!
Now I understand, I did it the way you people directed me and it worked!

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page