LINK : fatal error LNK1104: cannot open file 'ucrtd.lib' in VS2017 RC - c++

I keep getting an error when I build a C++ project in Visual Studio 2017 RC.
1>------ Build started: Project: test, Configuration: Debug x64 ------
1>Source.cpp
1>LINK : fatal error LNK1104: cannot open file 'ucrtd.lib'
1>Done building project "test.vcxproj" -- FAILED.
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
OS: Windows 8.1, Visual Studio 2017 Release Candidate
Here is my program:
int main()
{
}
I did not set the language to anything special
I searched my whole machine for the file., but could not find it.
I have installed Windows SDK 8.1
Update:
After the comment from #user1336087
I tried to install Windows SDK 10I get an error:
[14f0:0009][2016-11-23T09:22:20] Package 'Win10SDK_10.0.14393.33,version=10.0.14393.3300' failed to install. Command executed: "C:\ProgramData\Microsoft\VisualStudio\Packages\Win10SDK_10.0.14393.33,version=10.0.14393.3300\packages\Win10SDK\10.0.14393.33\sdksetup.exe" /features OptionId.WindowsSoftwareDevelopmentKit OptionId.WindowsSoftwareLogoToolkit OptionId.NetFxSoftwareDevelopmentKit /quiet /norestart, Return code: -2146889721, Details: The hash value is not correct.
A workaround seems to have been described here: link
But the workaround still fails, even when I uninstall all SDK and install again.

It works in the final version of Visual Studio 2017

This comment here helped me with the same error. It seems having old versions of the Windows SDK present can cause LINK to get confused. Deleting the old version I had fixed the problem.
https://community.intel.com/t5/Intel-Fortran-Compiler/LINK-fatal-error-LNK1104-cannot-open-file-ucrtd-lib-with-VS2015/td-p/1060422

Related

Unreal engine 4.26.2 source version errors when running

I'm trying to set up UE4.26.2 source version but haven't been successful. I have cloned the repo from github, ran Setup and GenerateProjectFiles without errors, set development editor and x64 in Visual studio 2019 and built it without errors but when I try to run the UE I always get the same two errors:
Build started...
1>------ Build started: Project: UE4, Configuration: Development_Editor x64 ------
1>Building UE4Editor and ShaderCompileWorker...
1>Using Visual Studio 2019 14.34.31937 toolchain (C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.34.31933) and Windows 10.0.20348.0 SDK (C:\Program Files (x86)\Windows Kits\10).
1>Building 2 actions with 16 processes...
1> [1/2] UE4Editor.exe
1>LINK : fatal error LNK1104: cannot open file 'D:\UE4.26.2\UnrealEngine-4.26.2-release\Engine\Binaries\Win64\UE4Editor.exe'
1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Microsoft\VC\v160\Microsoft.MakeFile.Targets(45,5): error MSB3073: The command "..\..\Build\BatchFiles\Build.bat -Target="UE4Editor Win64 Development" -Target="ShaderCompileWorker Win64 Development -Quiet" -WaitMutex -FromMsBuild" exited with code 6.
1>Done building project "UE4.vcxproj" -- FAILED.
========== Build: 0 succeeded, 1 failed, 2 up-to-date, 0 skipped ==========
LNK1104 cannot open file 'D:\UE4.26.2\UnrealEngine-4.26.2-release\Engine\Binaries\Win64\UE4Editor.exe'
MSB3073 The command "....\Build\BatchFiles\Build.bat -Target="UE4Editor Win64 Development" -Target="ShaderCompileWorker Win64 Development -Quiet" -WaitMutex -FromMsBuild" exited with code 6.
I have tried various different combinations of VS components, I have installed .net Desktop dev, desktop dev with c++ and game dev with c++. I am using .NET Framework 4.8 SDK with all the previous 4.x targeting packs. I have tried deleting certain content from the Win64 folder and other files which I can't recall, but after I run the UE4 it always builds them again so the errors persist.
I solved the issue. My avast antivirus put the "UE4Editor.exe" into quarantine, then I restored it and compiled and voila, it works

WinRT auto generated template compiling error in Visual Studio 2017

I am new to c++/WinRT. I am trying to create a new blank project under c++/WinRT using Visual Studio Pro 2017. But it gives some compiling error:
1>------ Build started: Project: BlankApp2, Configuration: Debug Win32 ------
1>Windows.AI.MachineLearning.MachineLearningContract.winmd
1>C:\Program Files (x86)\Windows Kits\10\References\10.0.17763.0\Windows.AI.MachineLearning.MachineLearningContract\1.0.0.0\Windows.AI.MachineLearning.MachineLearningContract.winmd : warning C4335: Mac file format detected: please convert the source file to either DOS or UNIX format
1>C:\Program Files (x86)\Windows Kits\10\References\10.0.17763.0\Windows.AI.MachineLearning.MachineLearningContract\1.0.0.0\Windows.AI.MachineLearning.MachineLearningContract.winmd(1): fatal error C1004: unexpected end-of-file found
1>midlrt : command line error MIDL1003: error returned by the C preprocessor (2)
1>Done building project "BlankApp2.vcxproj" -- FAILED.
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
I updated my Visual Studio 2017 to the latest version. I also used the latest WinRT. I could build a console application using the code in Kenny Kerr's command window sample code. But couldn't build the blank application created by the Visual Studio 2017 wizard. Any help is greatly appreciated.

Fatal error LNK1104: cannot open file 'sfml-system-s-d.lib'

I'am getting an error shown below, I'am using visual studio 2017 community and I'am trying to run a project I downloaded from github.
1>------ Build started: Project: CurveFever, Configuration: Debug Win32 ------
1>LINK : fatal error LNK1104: cannot open file 'sfml-system-s-d.lib'
1>Done building project "CurveFever.vcxproj" -- FAILED.
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
So far I have already uninstalled Visual Studio 2017 and re installing it again, I have already tried searching for questions similar to mine and what I found did not work. I have already checked whether sfml-system-s-d.lib is in the directory of my SFML folder and its in there.
Your linker seem not to be able to find 'sfml-system-s-d.lib'
You have to add the path to the library to the linker options:
Right-klick on your project->Properties->Linker->Additional Library Directories
Write the path to the folder containing your library, e.g. c:\lib\

CMake project in Visual Studio 2017 not rebuilding after first build

I have a project of roughly 50 files that I build with the CMake integration in Visual Studio 2017 (latest release, version 15.0.0+26228.9).
If I regenerate my CMake cache and then build, my project is built normally. However, if I change something in one of my files, then try to rebuild without regenerating my CMake cache, nothing happens.
This is what the build window looks like:
Build started ...
========== Build: 0 succeeded, 0 failed, 1 up-to-date, 0 skipped ==========
Nothing will be built until I regenerate my CMake cache, where I will only be able to build once before getting the same issue.
Same issue happens on any CMake project I try to build. This issue only started happening on the latest full release of Visual Studio 2017, this did not happen in the RC builds.
I ended up repairing the Visual Studio 2017 install from the Visual Studio installer and that fixed it. Everything works as intended now.

Marmalade ErrorCode 4 while building mkb project

I've got a project from my teacher, that I should run in the Marmalade Hub. I've imported this project en tried to run it. At first I got an error with the error code 7.
error: Visual Studio 2013 Express Windows Desktop requested but not found instal
led.
FAILED (error code=7)
I've fixed this problem to change the C++ Development (IDE's and Compilers) from 'Visual studio Express 2013 Windows Desktop' to 'Visual Studio 2013' (see image below). I did this change, because I do have 'Visual Studio Proffesional 2013 for Windows Desktop' and not 'Visual Studio Express 2013 for Windows Desktop'. 'Visual Studio 2013 Proffesional 2013 for Windows Desktop' doesn't exist in the drop down.
I tried again to run the project (see image below) and I did get another error with the error code 4:
-- Visual Studio Output --
1>------ Build started: Project: minimal_marmalade_vc12, Configuration: x86 Debu
g Win32 ------
1>LINK : warning LNK4075: ignoring '/INCREMENTAL' due to '/FORCE' specification
1>LINK : fatal error LNK1181: cannot open input file 'cgl_d.lib'
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
-- End Visual Studio Output --
error: build failed: '['C:\\Program Files (x86)\\Microsoft Visual Studio 12.0\\C
ommon7\\IDE\\devenv.exe', 'minimal_marmalade_vc12.sln', '/build', 'X86 Debug', '
/out', 'vs_output_11728.log']' (1)
FAILED (error code=4)
I hope you guys (or girls ;) ) can solve this problem. Thanks!
Maybe that your project uses the library Core Media Library. Check whether used somewhere in the code header file cgl.h If so, then reinstall Core Media Library Instalation instructions you find in this guide