[vlc-devel] UCRT support in MinGW-w64

Martin Storsjö martin at martin.st
Sun Nov 24 22:09:20 CET 2019


On Sun, 24 Nov 2019, Stephen Kitt wrote:

>> On Thu, 21 Nov 2019, Stephen Kitt wrote:
>>> So I’m pondering switching the default to UCRT, to better match what
>>> Visual Studio does nowadays, and allow targeting UWP without too many
>>> contorsions...
>>
>> The main gotcha regarding this, is that UCRT isn't available out of the
>> box before Windows 10, but it requires installing a separate
>> redistributable. With MSVC, this isn't quite as much of an issue as you
>> can choose to statically link the CRT there, but that's not possible in
>> mingw-w64.
>>
>> And I've understood that this is a blocker for using UCRT for the VLC
>> releases.
>
> That is indeed a good point. I guess Visual Studio doesn’t bother with
> pre-Windows 10 targets too much, so using that as a reference to justify
> a switch to UCRT isn’t necessarily appropriate!

I don't think MSVC users don't care about pre-Windows 10 targets, but such 
users generally either are ok with bundling the UCRT redistributable 
installer with the installer of one's application, or link the UCRT 
statically.

The former, bundling UCRT with the app, is totally ok with mingw-w64, as 
long as it is ok with the license of the shipped application. I would 
presume it isn't ok for pure GPL software, but would probably be ok with 
many other licenses. I think one can get the UCRT redistributables 
directly as such from microsoft (normally they are available as part of 
the WinSDK and/or MSVC installation).

IIRC the proper way of doing this is by bundling an UCRT installer, but 
I've seen cases where ucrtbase.dll and api-ms-win-crt-*.dll are bundled 
directly as well; not sure if the latter is blessed by Microsoft or not 
though.

The latter option, statically linking the CRT, only is possible with MSVC 
though. That option probably is the best one for things that need to run 
really standalone.

// Martin


More information about the vlc-devel mailing list