Swift licensing questions (Windows platform)

UCRT is not a complete C library but rather a small component of the larger system. The UCRT headers are in fact part of the Windows SDK, but cannot be used without VCRuntime which is provided only through Visual Studio.

  • WinSDK and VS headers and import libraries are sufficient for "normal" SPM development, assuming that you are only building "hello world" types of applications. Anything beyond that and you will need additional tools which are either part of WinSDK or Visual Studio (e.g. mt, rc, etc; yes, LLVM has some attempt to implement these, they are nowhere near usable).

  • The Microsoft compiler is not used during the compilation of the code. However, the debugger is often needed to actually debug the program. In the case of UI applications, Visual Studio is going to be needed (e.g. for debugging the view tree).

  • As stated above, UCRT still is not completely standalone, and so you must have an installation of Visual Studio. It is provides VCRuntime which is a dependency for the UCRT.

  • The Windows SDK is absolutely required, but the instructions use Visual Studio to install it to simplify them (and the management too). You can install the SDK separately and then install Visual Studio to provide the remaining headers and import libraries.

The whole library dependency thing here is a mess. If you note, the Swift overlay is now also called CRT (which was original MSVCRT). The renaming was done due to the UCRT shuffle, which introduces the AppCRT, DesktopCRT, UCRT on top, and all of them built a top of VCRuntime. However, all of these still have a dependency on VCRuntime.

The general thought that "UCRT" is there, why do I need "VCRuntime" is like saying, I have UIKit, why do I need Foundation?

3 Likes