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.
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.
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
VCToolsVersionenvironment 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
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
"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:
- Using Minor Version Toolsets with the command prompt
- Using the Microsoft C++ toolset from the command prompt
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:
- Select an auto-detected MSVC configuration and choose Clone.
- Rename it to "Microsoft Visual C++ Compiler 16.6 (amd64)"
- 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.
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:
- select the kit for the target hardware and choose Build.
- Select Details under the Build Environment section.
- Select Add to create
VCToolsInstallDirenvironment 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.