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

Cannot open ucrt.lib

Richard_S_9
Beginner
3,248 Views

I have just recently installed Visual Studio 2015 and Intel Fortran.

During the build process I get the error,   "error 1104, cannot open ucrt.lib"

I am linking with the nodefaultlib option set to "No" ( setting it to "Yes" results in the same error message).

I have confirmed that the file ucrtbase.dll exists in C:\Program Files(x86)\Windows Kits\10.

I have confirmed that the file ucrtbased.dll exists in C:\Windows\System32.

Can you help with this problem?

 

0 Kudos
15 Replies
Steven_L_Intel1
Employee
3,248 Views

Try this first. In Visual Studio, select Tools > Options > Intel Compilers and Tools > Visual Fortran > Compilers. Click the Reset... button and then  Click on the x64 tab and then repeat clicking on Reset...

In the Libraries list (for Win32) you should see:

$(WindowsSdkDir)lib\winv6.3\um\x86
$(UniversalCRTSdkDir)lib\winv10.0\ucrt\x86
$(UniversalCRTSdkDir)Lib\$(UCRTVersion)\ucrt\x86

If you don't, add any missing entries. For x64 it should include:

$(WindowsSdkDir)lib\winv6.3\um\x64
$(UniversalCRTSdkDir)lib\winv10.0\ucrt\x64
$(UniversalCRTSdkDir)Lib\$(UCRTVersion)\ucrt\x64

Does this help?

0 Kudos
Richard_S_9
Beginner
3,248 Views

Steve

The entries

$(WindowsSdkDir)lib\winv6.3\um\x86
$(UniversalCRTSdkDir)lib\winv10.0\ucrt\x86
$(UniversalCRTSdkDir)Lib\$(UCRTVersion)\ucrt\x86

$(WindowsSdkDir)lib\winv6.3\um\x64
$(UniversalCRTSdkDir)lib\winv10.0\ucrt\x64
$(UniversalCRTSdkDir)Lib\$(UCRTVersion)\ucrt\x64

appear under the 32 and 64 tabs,

but the 1104 error persists.

Richard

Any ideas?

0 Kudos
Steven_L_Intel1
Employee
3,248 Views

Add the full path to where you find the .lib file (not the .dll) into the Libraries list. It will be different for Win32 and x64. But first you may want to install Update 1 to VS2015 and see if that resolves the problem, https://www.visualstudio.com/news/vs2015-update1-vs

0 Kudos
Richard_S_9
Beginner
3,248 Views

Steve,

I have searched under C: for the files ucrt.lib and ucrt.lib and they are not found. This explains why the Intel Fortran Compiler "cannot open ucrt.lib". Hence I cannot carry out your suggestion to add the full path into the Libraries list.

A discussion from Microsoft at the site,

http://blogs.msdn.com/b/vcblog/archive/2015/03/03/introducing-the-universal-crt.aspx

implies that the ucrt files have been renamed to ucrtbase.dll and ucrtbased.dll for the release and debug configurations respectively. Should Intel be using these file names in your Fortran software?

Do these comments shed any light on my problem?

Richard

 

0 Kudos
TimP
Honored Contributor III
3,248 Views
On the vs2015.1 install menu, selecting c++ and SDK 10240 then reopening ifort environment did the job for several of us.
0 Kudos
Richard_S_9
Beginner
3,248 Views

Tim

Where do I find the "VS2015.1 install menu"?

Does this process require a complete download and reinstall of VS2015?

I took a preliminary look at using the Change procedure in Control Panel/Programs/Programs and Features/Change, but I wasn't comfortable with that procdure. I didn't think it was what you meant by "VS2015.1 install menu". 

What do you recommend? 

Richard

0 Kudos
TimP
Honored Contributor III
3,248 Views

Yes, the control panel programs and features menu is the way to update and open the VS2015 install menu.

In the past, if you started with a pre-release version of VS2015, it was necessary to remove it, delete both its folder and the windows kits\10\ and install vs2015.1 from the URL which Steve gave.

0 Kudos
Steven_L_Intel1
Employee
3,248 Views

I have ucrt.lib in C:\Program Files (x86)\Windows Kits\10\Lib\10.0.10240.0\ucrt\x86 as installed by VS2015.

0 Kudos
Richard_S_9
Beginner
3,248 Views

Steve

 I do not have quite the same file structure as you.

I have    C:\Program Files (x86)\Windows Kits\10\Redist\ucrt\DLLs\X86\ucrtbase.dll

The use of ucrtbase  and ucrtbased (for debugging)instead of place of ucrt is discussed by Microsoft at

http://blogs.msdn.com/b/vcblog/archive/2015/03/03/introducing-the-universal-crt.aspx

It's interesting that they suggest linking to ucrt.lib if ucrtbase doesn't work, and yet they have not provided the ucrt.lib and/or ucrt.dll files with my VS2015.

I would point out that I downloaded my VS2015 about two weeks ago so it should be current. It does have Update1 and, as pointed out above, the ucrtbase files.

So Steve it appears that I have two problems:

   1. Microsoft doesn't provide the ucrt files)

   2. Intel doesn't reference the new files with the root "ucrtbase".

So I am caught between an apparent lack of communication between two of the worlds largest and most prestigious organizations. (I am saying that with a smile and I really do appreciate your help.) So where do we go from here?

Richard  

0 Kudos
Steven_L_Intel1
Employee
3,248 Views

You're looking in the wrong place. There should be a Lib folder in the same one where you found Redist. If not, you have not properly installed VS2015. My guess is that you didn't select C++ support, which is required. The default VS2015 install doesn't include this.

Run the VS2015 install again, select Change or Modify, and make sure that Programming Languages > C++ is checked, then complete the install.

0 Kudos
Richard_S_9
Beginner
3,248 Views

Steve,

I ran the VS2015 install from Control Panel, selecting Change and Modify. I selected C++ and the necessary files were installed (about 3GB). ! This solved the problem ! The program compiles and links with no errors. The file structure now matches yours.

I haven't decided that not selecting C++during the initial installation was my fault or Microsoft's or Intel's, but I am willing to take my share of the blame. My program is a mix of Visual Basic and Fortran and I focused on these two options during the installation of VS2015, not thinking to select C++. You might want to review the installation instructions (Intel's and/or Microsoft's) to avoid this type of problem going forward.

Regardless, I want to thank you for all your prompt and patient help. Happy New Year!

Richard 

 

0 Kudos
Steven_L_Intel1
Employee
3,248 Views

This SHOULD be in Intel's instructions and I am fairly certain the Intel installer warns you if it doesn't see this, but it still allows you to proceed and I think it shouldn't. I will raise this again with the installer team.

0 Kudos
Jordi_G_
Beginner
3,248 Views

Hello,

I have the same problem trying to build a dll and I have tried the following:

- Visual Studio 2013 Professional and Intel Fortran Composer 2013: it works

- Visual Studio 2015 Community Edition, including C++ and SDK and Intel Fortran Cluster 2016: "error 1104, cannot open ucrt.lib"

I have followed the steps given above, but I can't find the file ucrt.lib in my computer yet. Any idea why the file is not installed after installing C++ and SDK 10?

Thanks and regards,

Jordi

0 Kudos
Steven_L_Intel1
Employee
3,248 Views

Update VS2015 to Update 1 and see if that helps. Do the Reset as suggested after you do that.

0 Kudos
Jordi_G_
Beginner
3,248 Views

Hello Steve:

Update 1 was already installed (I apologize for not giving this information before).

I fixed the issue installing SDK 8.1 in VS2015 (for some reason, SDK 10 was not enough even if I'm running on Windows 10!) 

Thanks and regards,

Jordi

0 Kudos
Reply