Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.
Announcements
Welcome to the Intel Community. If you get an answer you like, please mark it as an Accepted Solution to help others. Thank you!
26731 Discussions

link error LNK1104: cannot open file 'libucrt.lib'

Michael8
Beginner
1,028 Views

Hello:

I have VS 2015 Professional 2015, Update 3, and I have Visual Fortran XE 15.0.4.221.  All of my Fortran programs are compiling fine, but then giving me the link error: LNK1104: cannot open file 'libucrt.lib'.

It appears as though the problem lies in the setting for the libraries as to where the libucrt.lib file resides.  When I look at the list of libraries in the Tools-->Options-->Intel Compilers and Tools-->Visual Fortran-->Compilers-->Libraries, it has hard-coded in the path $(UniversalCRTSdkDir)Lib\10.0.10056.0\ucrt\x86.  But that directory does not exist on my machine.  The problem is the number "10.0.10056.0".  If I change that to a directory that actually exists on my machine (e.g., 10.0.10150.0, or 10.0.10240.0), then things work and compile just fine.

My question is two fold:
1) Where did the incorrect path (10.0.10056.0) come from?
2) Are we doing something wrong in the installation that could be causing this error?  We are in the middle of rolling out new installations for many people in the office, and it would be a big pain to have to go to each person and correct the settings one by one.

Thanks for your help.
Michael

0 Kudos
13 Replies
Steve_Lionel
Black Belt Retired Employee
1,028 Views

This generally happens when an update is installed after a VS2015 update. The usual fix is to click "Reset..." on that Tools > Options dialog. Once you fix it this way, it should stay fixed. But I would also recommend a newer version of Parallel Studio XE, as 15.0.4 was the very first to support VS2015 and there might have been issues there.

Michael8
Beginner
1,028 Views

When I click on the reset button, the path doesn't change.  It still says: $(UniversalCRTSdkDir)Lib\10.0.10056.0\ucrt\x86

The 10.0.10056.0 is still hard-coded in there.  Am I missing something?

Thanks.
Michael

Steve_Lionel
Black Belt Retired Employee
1,028 Views

I think that 15.0.4 made some assumptions based on the beta versions of VS2015. Try adding:

$(UniversalCRTSdkDir)Lib\$(UCRTVersion)\ucrt\x86

for x86 and:

$(UniversalCRTSdkDir)Lib\$(UCRTVersion)\ucrt\x64

for x64

to the list (or replace the bad path with this.) My memory is a bit foggy now, but my recollection is that later versions of Parallel Studio XE used the newer path.

Michael8
Beginner
1,028 Views

I tried adding that to the list, but it came back with the same link error, and also said:

Project : warning PRJ0018 : The following environment variables were not found:
$(UCRTVersion)

I'll see if we have a newer version of the compiler that we can install.

Thanks.
Michael

 

Steve_Lionel
Black Belt Retired Employee
1,028 Views

Try:

$(UniversalCRTSdkDir)lib\winv10.0\ucrt\x86

then

Michael8
Beginner
1,028 Views

Actually, that directory is already in the list.  It doesn't work because I don't have a $(UniversalCRTSdkDir)lib\winv10.0 directory.

We are looking into installing a newer version of Fortran.  We can't find anything newer within the Fortran XE 2015 world.  We tried Fortran XE 2016 (I think) and XE 2017, but they didn't seem to not be compatible with VS 2015.  Can you recommend a specific version that we should try?

Thanks.
Michael

Steve_Lionel
Black Belt Retired Employee
1,028 Views

Yes, the XE 2016 and 2017 versions are compatible with VS2015.

Very strange.

On my system, the library is in C:\Program Files (x86)\Windows Kits\10\Lib\10.0.10240.0\ucrt\x64 (for x64). See where yours are and substitute as needed.

Michael8
Beginner
1,028 Views

Ok, that's good to know that XE 2016 and XE 2017 are supported with VS 2015.  Maybe something just didn't go right with those installations.  We should retry that.

Yes, I can manually change the library path to a path that exists on my machine, and then programs compile and link.  But we are trying to install this software for many, many users, and so that seems odd to have to do that extra manual step for each user.  We assumed something just isn't going correctly with the installation.  I'll look into seeing if we can use XE 2016 or XE 2017, and if that resolves the issue.

Thanks.
Michael

Michael8
Beginner
1,028 Views

If we install XE 2017, can we use all the default installation options, or do we need to do a custom install.  I recall reading, a while back, about needing to do a custom install to make sure to install the C++ components.  But I'm not sure if that's still necessary.

Thanks.
Michael

Steve_Lionel
Black Belt Retired Employee
1,028 Views

That's for the VS install, not Parallel Studio XE. (See here.) A default install is fine.

Michael8
Beginner
1,028 Views

Oh yes, I was getting confused.  Thanks for that link.  We'll give it a try.

Thanks.
Michael

Michael8
Beginner
1,028 Views

So we installed XE2017, and that worked.  No more linking error.  Thanks for your help on this!

Michael

Steve_Lionel
Black Belt Retired Employee
1,028 Views

Hooray!

Reply