question

RetoFelix-9471 avatar image
0 Votes"
RetoFelix-9471 asked RetoFelix-9471 commented

Select UCRT for legacy windows target

I create a C++ Project with Visual Studio 2019 for Windows 8.1.

The used UCRT is from Windows Kits\10\Source\10.0.10240.0\ucrt.
But in this Version are some bugs.

How can I used a newer UCRT (SDK) for Windows 8.1 projects?

RetoFelix

c++
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

JeanineZhang-MSFT avatar image
0 Votes"
JeanineZhang-MSFT answered RetoFelix-9471 commented

Hi,

I suggest you could install the winsows sdk you need in the visual studio installer.

Visual Studio Installer -> modify -> Individual components -> SDKs,libraries and frameworks

You could choose download and install the SDK which you want.

92388-4291.png

And then you could choose the ucrt you want to use for your project. Right click the project-> Properties -> General -> Windows SDK Version

92389-4292.png

Best Regards,

Jeanine Zhang




If the response is helpful, please click "Accept Answer" and upvote it.

Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.



4291.png (28.3 KiB)
4292.png (26.9 KiB)
· 1
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Hi,
Thank You for your explanation.

But when I select legacy Toolset v141_xp the only available SDK is 7 and there is the UCRT from 10240 with some bugs.
92502-v141-xp.png

I know XP is out of support. But in some situations, it is required.

Can I change the UCRT for v141_xp?

RetoFelix

0 Votes 0 ·
v141-xp.png (35.4 KiB)
JeanineZhang-MSFT avatar image
0 Votes"
JeanineZhang-MSFT answered

Hi

@RetoFelix-9471

If you want to configuring programs for Windows XP, you just use the Visual Studio 2017 v141_xp toolset.

For more details I suggest you could refer to the Doc: Configuring Programs for Windows XP

According to the Doc:

The UCRT is now a Windows component, and ships as part of Windows 10. The static library, DLL import library, and header files for the UCRT are now found in the Windows 10 SDK. When you install Visual C++, Visual Studio setup installs the subset of the Windows 10 SDK required to use the UCRT. You can use the UCRT on any version of Windows supported by Visual Studio 2015 and later versions. You can redistribute it using vcredist for supported versions of Windows other than Windows 10.

As I mentioned above, you could install the winsows sdk you need in the visual studio installer. Whether you have installed the winsows sdk you want in Individual components?

92729-4301.png

Best Regards,

Jeanine Zhang





If the response is helpful, please click "Accept Answer" and upvote it.

Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.



4301.png (26.5 KiB)
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

RetoFelix-9471 avatar image
0 Votes"
RetoFelix-9471 answered RetoFelix-9471 commented

HI
I know to build for Windows XP.
I have installed the following Toolset and the SDK 10.0.18362.0 for windows 10.
92905-1.png

92918-3.png
As soon as I select v141_xp as toolset and select apply the options are changed and only SDK 7.0 is available.
92877-2.png
With SDK 7.0 the UCRT from Windows Kits\10\Source\10.0.10240.0\ucrt is used.
Normaly I link staticly to the CRT so no deploy of CRT is required.
But the static UCRT in 10.0.10240.0 has some bugs.
When I use the toolset v142 with SDK 10.0.18362.0 the UCRT from Windows Kits\10\Source\10.0.18362.0\ucrt is staticly linked and the bug is gone.
But then Windows XP is no longer supported.

So my question who can I use v141_xp toolset with a newer UCRT then 10.0.10240.0?

RetoFelix


1.png (26.5 KiB)
3.png (101.5 KiB)
2.png (32.5 KiB)
· 3
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

@RetoFelix-9471

According to your description, I checked it on my side and choose the Visual Studio 2017 - Windows XP (v141_xp)' for Platform Toolset and the Windows SDK Version auto changed to '7.0'. It seems that when you use the v141_xp as the toolset, you could only use SDK version 7.0. You couldn't use v141_xp toolset with a newer UCRT then 10.0.10240.0.

0 Votes 0 ·

The UCRT is not intended to be used on any Windows version older than Vista. If you take a look at the system requirements listed here - Windows 10 Universal C Runtime and here - update-for-universal-c-runtime-in-windows-c0514201-7fe6-95a3-b0a5-287930f3560c you can see that XP is not supported. So when building for XP, the UCRT is not used. That's why the the SDK version is automatically set to 7.0.


0 Votes 0 ·

Thank you for your answer.
So I must life with bugs in UCRT 10.0.10240.0 as long as build for XP is required.
RetoFelix

0 Votes 0 ·