When using the Microsoft compiler in a Qt project, error messages and warnings with broken encoding are displayed in the assembly window. For example:

warning C4311: ЇаЁўҐ¤ҐЁҐ вЁЇ®ў: гбҐзҐЁҐ гЄ § вҐ«п Ё§ "Qt::HANDLE" ў "unsigned int" warning C4302: ЇаЁўҐ¤ҐЁҐ вЁЇ®ў: гбҐзҐЁҐ Ё§ "Qt::HANDLE" ў "unsigned int" 

How can you display such messages in an adequate readable form, in Russian or English?

  • Maybe just do not put the Russian language pack? - VTT
  • @VTT specifically he was not put, as I recall. Probably crawled due to the fact that Windows is Russian. - αλεχολυτ

1 answer 1

One of the possible solutions is to hide files with OS language strings for the cl.exe compiler. In this case, we are talking about the ru-ru locale with the LCID of 1049 . A complete list of identifiers can be found here , it is worth considering that there they are listed in hexadecimal.

Depending on the version and bit depth of the compiler chosen for the Qt project, the location of the cl.exe file may vary. For example, for MSVC2015 64bit, the path would be:

 {Коренная папка Visual Studio}\VC\bin\amd64 

In MSVC2017, the structure of the path is somewhat different:

 {Коренная папка Visual Studio}\VC\Tools\MSVC\{версия}\bin\Hostx86\x64 

The name of the destination folder can be found in the project build settings in QtCreator:

Compiler path

For MSVC2017 x86_amd64 , shown in the figure, it will just correspond to Hostx86\x64 (the final part of the path).

Along this path, it is enough to rename the folder "1049" , for example, by adding the underscore "1049_" , and then reassemble the project. Compiler messages will be displayed in English:

 warning C4311: 'type cast': pointer truncation from 'Qt::HANDLE' to 'unsigned int' warning C4302: 'type cast': truncation from 'Qt::HANDLE' to 'unsigned int' 

It is worth noting that the presence of a folder with the English language, i.e. "1033" is necessary for non-English OS. You can install or uninstall some languages ​​in the Visual Studio installer:

VS Installer