Fixing G13071FE error

If building Qt for MCUs based application results in an error message like this:

error G13071FE8: STL1000: Unexpected compiler version, expected Clang 11.0.0 or newer.

It means that the Microsoft Visual C++ Compiler (MSVC) version installed on your host environment is not supported. Note that Qt for MCUs 1.9 is compatible with version v14.16 up to v14.28.

Installing supported version of MSVC

To fix this, install one of the supported versions of MSVC. This can be done by launching Visual Studio installer or downloading Build Tools for Visual Studio. Follow instructions provided on this Microsoft C++ Team Blog: Side-by-side Minor Version MSVC Toolsets in Visual Studio 2019. Make sure that at least one of the supported versions is selected:

Note: It is not necessary to uninstall any incompatible versions that are present in your system.

When multiple versions of MSVC are installed in your host environment, the most recent one is selected automatically. In case that recent version is not compatible with Qt for MCUs, some additional configuration is necessary.

Command line setup

Building desktop applications

The following are the two possible solutions for selecting an MSVC version that will be used by CMake to configure your Qt for MCUs application for desktop.

  • Set the VCToolsVersion environment variable (see Using Minor Version Toolsets with CMake):
    set VCToolsVersion=14.28.29333
    cmake .. -DQUL_PLATFORM=Qt -Ax64
  • Provide version string as part of CMake call:
    cmake .. -DQUL_PLATFORM=Qt -Ax64 -Tversion=14.28

Building for the target hardware

When building your application, Clang infrastructure used by the Qt for MCUs tools will automatically detect the standard library headers installed with MSVC. To ensure that those library headers are for the supported MSVC version, configure the Visual Studio Developer Command Prompt using the vcvars_ver argument:

"C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Auxiliary\Build\vcvarsall.bat" amd64 -vcvars_ver=14.28.29333

Refer to the following developer blogs for more information:

Qt Creator setup

Building desktop applications

When working with the desktop backend, update the compiler settings accordingly. Launch Qt Creator and select the Tools > Options menu. Select Kits in the left pane and switch to the Compilers tab. Review detected MSVC compilers for C and C++. If reported versions are not the compatible ones, create a custom configuration using the following instructions:

  1. Select an auto-detected MSVC configuration and choose Clone.
  2. Rename it to "Microsoft Visual C++ Compiler 16.6 (amd64)"
  3. Add the following argument to the last text input field in the "Initialization" section:

    Note: Do this for both C and C++ compiler configurations.

Switch back to Kits tab and select the Qt for MCUs 1.9 - Desktop 32bpp kit. Check if the updated compiler settings are in use by selecting MSVC configuration for C and C++ created in previous step. Finally, select OK to close the window.

If your project was already created, update its CMake configuration. To do this, select Build > Clear CMake Configuration followed by Build > Run CMake to configure again.

Building for the target hardware

If you are using Qt Creator, update your project settings to ensure that Clang infrastructure used by the Qt for MCUs tools is able to locate correct version of MSVC. To do this, follow these instructions:

  1. select the kit for the target hardware and choose Build.
  2. Select Details under the Build Environment section.
  3. Select Add to create VCToolsInstallDir environment variable that points to installation directory of correct MSVC version, such as:
    C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Tools\MSVC\14.28.29333

Exact location depends on the MSVC version you installed. For MSVC 2019, the default installation path is C:\Program Files (x86)\Microsoft Visual Studio\2019\<edition>. Edition may be Community, Professional, Enterprise, BuildTools, or another name you supplied during the installation process.

Available under certain Qt licenses.
Find out more.