Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to I update my C++ project in Visual Studio 2015 to use the new Universal CRT?

After VS2015 updated my project to the new Platform toolset v140, it fails to build due to a linker error : LNK1104 cannot open file 'libucrt.lib'.

It appears this library has been moved around due to the new Universal CRT as mentioned in this article : http://blogs.msdn.com/b/vcblog/archive/2015/03/03/introducing-the-universal-crt.aspx?PageIndex=2.

While the article does tell me what I should link towards now, it does not provide instructions how.

My Solution generates a .exe and a .dll it uses. I do not know what to do with the matrix the article describes below.

Release DLLs (/MD ): msvcrt.lib vcruntime.lib ucrt.lib

Release Static (/MT ): libcmt.lib libvcruntime.lib libucrt.lib

like image 394
Jesse Meyer Avatar asked Jul 20 '15 23:07

Jesse Meyer


People also ask

How do I upgrade my Visual Studio project?

To upgrade a project created in an earlier version of Visual Studio, just open the project in the latest version of Visual Studio. Visual Studio offers to upgrade the project to the current schema. If you choose No, the project doesn't get upgraded.

Is Visual Studio compatible with C?

Visual Studio Code is a lightweight, cross-platform development environment that runs on Windows, Mac, and Linux systems. The Microsoft C/C++ for Visual Studio Code extension supports IntelliSense, debugging, code formatting, auto-completion. Visual Studio for Mac doesn't support Microsoft C++, but does support .

What is universal CRT extension SDK?

The Universal CRT is a Windows operating system component. It is a part of Windows 10. For Windows versions prior to Windows 10, the Universal CRT is distributed via Windows Update. There are Windows Update MSU packages for Windows Vista through Windows 8.1.

What is universal C runtime?

The Windows 10 Universal C Runtime (CRT) is a Windows operating system component. The Windows Update package on this page allows Windows desktop applications that depend on the Windows 10 Universal CRT release to run on Windows Vista SP2, Windows 7 SP1, Windows 8, and Windows 8.1 S14.


1 Answers

When you convert your project, you need to make sure you update both the includes AND the linker settings to point to the new CRT.

For includes, add the following:

$(UniversalCRT_IncludePath)

For link, add one of the following depending on your target processor:

$(UniversalCRT_LibraryPath_x86)
$(UniversalCRT_LibraryPath_x64)
$(UniversalCRT_LibraryPath_arm)
like image 76
Ryan Bemrose Avatar answered Oct 02 '22 14:10

Ryan Bemrose