Search code examples
c++gccwxwidgetsmingw-w64msvcrt

UCRT vs. MSVCRT for GCC 14.x


I am using MinGW64 together with Codelite and have just downloaded the latest GNU GCC version packages 14.1 and 14.2. For 14.1 I found 2 packages (UCRT and MSVCRT), for 14.2 I got only the UCRT version so far.

Trying to compile a wxWidgets project on Windows 11 with the different versions gives me a runtime error 0xc0000139 if I use UCRT, i.e. Windows doesn't find the entry point for "main". With the MSVCRT version it runs without problems.

The wxWidgets libraries have been compiled with GCC 12.2 (and no indication which of the options was active: posix-seh-rt).

Searching for solutions to switch to the modern UCRT option I fell over many articles, here and in other places which I have to say confused me more than they enlightened me (but that might be due to my advanced age...).

So I have the following questions:

  1. Is it necessary to compile the wxWidget libs with the same option (in my case UCRT)
  2. Do I have to configure somewhere for the compile/link process (e. g. with a switch), that UCRT shall be used?
  3. Is there anything else I have to consider?

Solution

  • It is absolutely crucial to compile library and you application with exactly the same tools etc and build options.