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

fatal error LNK1104 and LNK1561

szoisch
Beginner
2,509 Views

I installed Visual Studio Community 2015 and Parallel Studio XE 2015 Update 4. After initial problems with the integration of the Fortran specific parts in the Visual Studio interface (https://software.intel.com/en-us/forums/topic/562514#comment-1832665) ;, I opened a new project -> Fortran -> Console Application -> Main Program Code, which is the 'hello world' example. I tried to build this standard file with x86 and x64. If I choose x86, I get the error message "fatal error LNK1104: cannot open file 'ucrtd.lib'." If I run it with x64, I get instead the error message "fatal error LNK1561: entry point must be defined.". I used the repair option in the installation for both programs one more time, but the problem remains. 

Does anyone know what my problem is?

-----------------------------

Compiling with Intel(R) Visual Fortran Compiler XE 15.0.4.221 [IA-32]...
ifort /nologo /debug:full /Od /warn:interfaces /module:"Debug\\" /object:"Debug\\" /Fd"Debug\vc140.pdb" /traceback /check:bounds /check:stack /libs:dll /threads /dbglibs /c /Qvc14 /Qlocation,link,"C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\\bin" "c:\users\user\documents\visual studio 2015\Projects\Console1\Console1\Console1.f90"
error code 23 (returned by OpenValidateX) opening pdb Debug\vc140.pdb

Linking...
Link /OUT:"Debug\Console1.exe" /INCREMENTAL:NO /NOLOGO /MANIFEST /MANIFESTFILE:"Debug\Console1.exe.intermediate.manifest" /MANIFESTUAC:"level='asInvoker' uiAccess='false'" /DEBUG /PDB:"c:\Users\user\documents\visual studio 2015\Projects\Console1\Console1\Debug\Console1.pdb" /SUBSYSTEM:CONSOLE /IMPLIB:"c:\Users\user\documents\visual studio 2015\Projects\Console1\Console1\Debug\Console1.lib" "Debug\Console1.obj"
Link: executing 'link'
LINK : fatal error LNK1104: Datei "ucrtd.lib" kann nicht geöffnet werden.


Console1 - 2 error(s), 0 warning(s)

-----------------------------

Compiling with Intel(R) Visual Fortran Compiler XE 15.0.4.221 [Intel(R) 64]...
ifort /nologo /O2 /module:"x64\Debug\\" /object:"x64\Debug\\" /Fd"x64\Debug\vc140.pdb" /libs:static /threads /c /Qvc14 /Qlocation,link,"C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\\bin\amd64" "c:\users\user\documents\visual studio 2015\Projects\Console1\Console1\Console1.f90"
Compiling manifest to resources...
rc.exe /fo "x64\Debug\Console1.exe.embed.manifest.res" "x64\Debug\Console1.exe.embed.manifest.rc"
Microsoft (R) Windows (R) Resource Compiler Version 6.3.9600.17336
Copyright (C) Microsoft Corporation.  All rights reserved.

Linking...
Link /OUT:"x64\Debug\Console1.exe" /NOLOGO /MANIFEST /MANIFESTFILE:"x64\Debug\Console1.exe.intermediate.manifest" /MANIFESTUAC:"level='asInvoker' uiAccess='false'" /IMPLIB:"c:\Users\user\documents\visual studio 2015\Projects\Console1\Console1\x64\Debug\Console1.lib" "x64\Debug\Console1.obj" "x64\Debug\Console1.exe.embed.manifest.res"
Link: executing 'link'
LINK : fatal error LNK1561: Einstiegspunkt muss definiert werden.

Console1 - 1 error(s), 0 warning(s)

0 Kudos
8 Replies
Lorri_M_Intel
Employee
2,509 Views

I googled and found this link:  https://software.intel.com/en-us/articles/link-fatal-error-lnk1104-cannot-open-file-ucrtdlib-with-vs2015-rc

That should address the first scenario.

In the second one, you don't seem to have /SUBSYSTEM:CONSOLE in your link command.  I'm not familiar enough with VS2015 Community Edition to know how that might have happened, but please try adding that to the link command.

         Hope this helps --

                         --Lorri

 

0 Kudos
szoisch
Beginner
2,509 Views

Dear Lorri,

thank you very much for your comment. I added in the project properties -> linker -> system /subsystem:console to the x64 plattform. Now I get for both platforms only the message "LNK1104: cannot open file 'ucrtd.lib'". The reason why the command was not there is that I added x64 empty and not as a copy of the win32 platform in the configuration manager. I found the article that you are referring to, too, and I posted a comment there, as the workaround doesnt seem to work for me. Could it be that the workaround works only for the Composer XE and not for Professional or Cluster? 

Best, Stefan

 

 

0 Kudos
Steven_L_Intel1
Employee
2,509 Views

I've had some issues with this ucrtd.lib and found I had to reboot after installing VS2015 and Parallel Studio XE to get Visual Studio to supply the correct path to the folder containing it. 

0 Kudos
szoisch
Beginner
2,509 Views

I turned my back on VS2015 for the moment as I couldnt resolve the problem and it became a little bit too time consuming. I found an installer for VS2013 Community and with this no issues appear. Thanks for all the support!

0 Kudos
John_P_7
Beginner
2,509 Views

I am getting the same error ("fatal error LNK1104: cannot open file 'ucrtd.lib'") in VS2015, even after uninstalling, reinstalling, and attempting the fix here: https://software.intel.com/en-us/articles/link-fatal-error-lnk1104-cannot-open-file-ucrtdlib-with-vs2015-rc

Is there another manual fix to the problem?

0 Kudos
Devorah_H_Intel
Moderator
2,509 Views

 Visual Studio 2015 has changed the version number of the ucrt

C:\Program Files (x86)\Windows Kits\10\Lib\10.0.10150.0\ucrt

a reset to default gives:
$(UniversalCRTSdkDir)Lib\10.0.10056.0\ucrt\x86

instead of:
$(UniversalCRTSdkDir)Lib\10.0.10150.0\ucrt\x86

additionally the includes are missing the following entry:
$(UniversalCRTSdkDir)Include\10.0.10150.0\ucrt

See if these two corrections to includes help.


 

0 Kudos
John_P_7
Beginner
2,509 Views

Worked like a charm.  Thanks!

0 Kudos
Thomas_M_4
Beginner
2,509 Views

I was having a problem with VS2015 Enterprise not finding libucrt.lib

After changing the compiler library entry from 10.0.10056.0 to 10.0.10150.0 as mentioned above it still didn't work.

Turns out even though my computer has 10.0.10150.0 it also has 10.0.10240.0, changing the compiler library entry to 240 worked for me.

Thanks for the info!

 

 

0 Kudos
Reply