Problems with Open-Source Downloads read https://www.qt.io/blog/problem-with-open-source-downloads and https://forum.qt.io/post/638946

How to Create Qt6 version for MSVC2017



  • Hello,

    I would like to migrate my Qt5 based software to Qt6
    I use MSVC 2017

    I have download last Qt version (all packages) but there is no package available for MSVC2017 juste for MSVC2019 64bits
    In the documenation of QT, supported configurations for Qt6 is windows10 (x64 or x32) over MSVC2019

    So my questions are follwing :

    • first of all, is it possible to use Qt6 with MSVC2017 ?
    • How to generate kits Qt6_MSVC2017_32bits and QT6_MSVC2017_64bit ?
      • I tried to do that but i have a problem issue at the gneration cmake step
        • generation of the configuration wth MSVC2017_64bit + update of cmake + installation of python / perl and gnuwin32 ==> OK
      • cmake --build . ==> KO

    I would like to continue using MSVC2017. I would like avoid to install version 2019 of MSVC.

    Is somebody coudl explain me how to solve this problem in case of it is technically possible.


  • Lifetime Qt Champion

    @Sylvanus said in How to Create Qt6 version for MSVC2017:

    first of all, is it possible to use Qt6 with MSVC2017 ?

    You can try, as both compilers are compatible.
    "cmake --build . ==> KO" - you should be more specific. What exactly happens?



  • Hi jsulm

    Firsofall, thanks for your reply
    Second, if i have well understand your answer it seems to be technicaly possible to use Qt6 with MSVC2017. It sounds great !
    So I have a just to integrate this new configuration (x64) into MSVC2017 with Qt VS Tools.
    For the 32 bits version I need to generate it but how ?

    here is my log of the cmake results (just first errors)

    [1/5309] Building CXX object qtbase\src\tools\bootstrap\CMakeFiles\Bootstrap.dir__\corelib\serialization\qdatastream.cpp.obj
    FAILED: qtbase/src/tools/bootstrap/CMakeFiles/Bootstrap.dir///corelib/serialization/qdatastream.cpp.obj
    "C:\PROGRA~2\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.16.27023\bin\Hostx64\x64\cl.exe" /nologo /TP -DHAVE_CONFIG_H -DPCRE2_CODE_UNIT_WIDTH=16 -DPCRE2_DISABLE_JIT -DPCRE2_STATIC -DQT_BOOTSTRAPPED -DQT_NO_CAST_FROM_ASCII -DQT_NO_CAST_TO_ASCII -DQT_NO_FOREACH -DQT_USE_QSTRINGBUILDER -DQT_VERSION_MAJOR=6 -DQT_VERSION_MINOR=0 -DQT_VERSION_PATCH=0 -DQT_VERSION_STR="6.0.0" -DUNICODE -DWIN32 -DWIN64 -D_ENABLE_EXTENDED_ALIGNED_STORAGE -D_UNICODE -D_WIN64 -Iqtbase\src\tools\bootstrap....\3rdparty\pcre2\src -Iqtbase\src\corelib\Core_autogen\include -Iqtbase\include -Iqtbase\include\QtCore -Iqtbase\src\corelib -Iqtbase\src\corelib\global -Iqtbase\src\corelib..\3rdparty\tinycbor\src -Iqtbase\include\QtCore\6.0.0 -Iqtbase\include\QtCore\6.0.0\QtCore -Iqtbase\src\corelib..\3rdparty\zlib\src -Iqtbase\src\corelib..\3rdparty\double-conversion.. -Iqtbase\src\corelib..\3rdparty\double-conversion\include -Iqtbase\src\corelib.rcc -Iqtbase\mkspecs\win32-msvc -Iqtbase\src\3rdparty\pcre2\src -Iqtbase\src\xml\Xml_autogen\include -Iqtbase\include\QtXml -Iqtbase\src\xml -Iqtbase\include\QtXml\6.0.0 -Iqtbase\include\QtXml\6.0.0\QtXml -Iqtbase\src\tools\bootstrap.. -Iqtbase\src\tools\bootstrap....\3rdparty\tinycbor\src -Iqtbase\src\tools\bootstrap....\3rdparty\zlib\src /DWIN32 /D_WINDOWS /GR /EHsc /Zi /RTC1 -MDd /W3 -Zc:cplusplus -permissive- -utf-8 -FS -Zc:rvalueCast -Zc:inline -Zc:strictStrings -Zc:throwingNew -Zc:referenceBinding -Zc:wchar_t -std:c++17 /showIncludes /Foqtbase\src\tools\bootstrap\CMakeFiles\Bootstrap.dir__\corelib\serialization\qdatastream.cpp.obj /Fdqtbase\src\tools\bootstrap\CMakeFiles\Bootstrap.dir\Bootstrap.pdb /FS -c qtbase\src\corelib\serialization\qdatastream.cpp
    [2/5309] Building CXX object qtbase\src\tools\bootstrap\CMakeFiles\Bootstrap.dir__\corelib\serialization\qjsondocument.cpp.obj
    FAILED: qtbase/src/tools/bootstrap/CMakeFiles/Bootstrap.dir/
    /__/corelib/serialization/qjsondocument.cpp.obj
    "C:\PROGRA~2\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.16.27023\bin\Hostx64\x64\cl.exe" /nologo /TP -DHAVE_CONFIG_H -DPCRE2_CODE_UNIT_WIDTH=16 -DPCRE2_DISABLE_JIT -DPCRE2_STATIC -DQT_BOOTSTRAPPED -DQT_NO_CAST_FROM_ASCII -DQT_NO_CAST_TO_ASCII -DQT_NO_FOREACH -DQT_USE_QSTRINGBUILDER -DQT_VERSION_MAJOR=6 -DQT_VERSION_MINOR=0 -DQT_VERSION_PATCH=0 -DQT_VERSION_STR="6.0.0" -DUNICODE -DWIN32 -DWIN64 -D_ENABLE_EXTENDED_ALIGNED_STORAGE -D_UNICODE -D_WIN64 -Iqtbase\src\tools\bootstrap....\3rdparty\pcre2\src -Iqtbase\src\corelib\Core_autogen\include -Iqtbase\include -Iqtbase\include\QtCore -Iqtbase\src\corelib -Iqtbase\src\corelib\global -Iqtbase\src\corelib..\3rdparty\tinycbor\src -Iqtbase\include\QtCore\6.0.0 -Iqtbase\include\QtCore\6.0.0\QtCore -Iqtbase\src\corelib..\3rdparty\zlib\src -Iqtbase\src\corelib..\3rdparty\double-conversion.. -Iqtbase\src\corelib..\3rdparty\double-conversion\include -Iqtbase\src\corelib.rcc -Iqtbase\mkspecs\win32-msvc -Iqtbase\src\3rdparty\pcre2\src -Iqtbase\src\xml\Xml_autogen\include -Iqtbase\include\QtXml -Iqtbase\src\xml -Iqtbase\include\QtXml\6.0.0 -Iqtbase\include\QtXml\6.0.0\QtXml -Iqtbase\src\tools\bootstrap.. -Iqtbase\src\tools\bootstrap....\3rdparty\tinycbor\src -Iqtbase\src\tools\bootstrap....\3rdparty\zlib\src /DWIN32 /D_WINDOWS /GR /EHsc /Zi /RTC1 -MDd /W3 -Zc:__cplusplus -permissive- -utf-8 -FS -Zc:rvalueCast -Zc:inline -Zc:strictStrings -Zc:throwingNew -Zc:referenceBinding -Zc:wchar_t -std:c++17 /showIncludes /Foqtbase\src\tools\bootstrap\CMakeFiles\Bootstrap.dir__\corelib\serialization\qjsondocument.cpp.obj /Fdqtbase\src\tools\bootstrap\CMakeFiles\Bootstrap.dir\Bootstrap.pdb /FS -c qtbase\src\corelib\serialization\qjsondocument.cpp
    d:\qt\6.0.0\src\qtbase\include\qtcore../../src/corelib/text/qregularexpression.h(116): error C2144: erreur de syntaxeÿ: 'int' doit ˆtre pr‚c‚d‚ de '}'
    d:\qt\6.0.0\src\qtbase\include\qtcore../../src/corelib/text/qregularexpression.h(116): error C2062: type 'int' inattendu
    d:\qt\6.0.0\src\qtbase\include\qtcore../../src/corelib/text/qregularexpression.h(118): error C2143: erreur de syntaxeÿ: absence de ';' avant '}'
    d:\qt\6.0.0\src\qtbase\include\qtcore../../src/corelib/text/qregularexpression.h(118): error C2238: jetons inattendus avant ';'
    d:\qt\6.0.0\src\qtbase\include\qtcore../../src/corelib/text/qregularexpression.h(93): error C2065: 'd'ÿ: identificateur non d‚clar‚
    d:\qt\6.0.0\src\qtbase\include\qtcore../../src/corelib/text/qregularexpression.h(93): error C2039: 'd'ÿ: n'est pas membre de 'QRegularExpression'
    d:\qt\6.0.0\src\qtbase\include\qtcore../../src/corelib/text/qregularexpression.h(65): note: voir la d‚claration de 'QRegularExpression'
    d:\qt\6.0.0\src\qtbase\include\qtcore../../src/corelib/text/qregularexpression.h(119): error C2065: 'MatchOption'ÿ: identificateur non d‚clar‚
    d:\qt\6.0.0\src\qtbase\include\qtcore../../src/corelib/text/qregularexpression.h(119): error C2923: 'QFlags'ÿ: 'MatchOption' n'est pas un argument de type modŠle valide pour le paramŠtre 'Enum'
    d:\qt\6.0.0\src\qtbase\include\qtcore../../src/corelib/text/qregularexpression.h(119): error C2641: impossible de d‚duire l'argument template pour 'QFlags'
    d:\qt\6.0.0\src\qtbase\include\qtcore../../src/corelib/text/qregularexpression.h(123): error C2061: erreur de syntaxeÿ: identificateur 'MatchType'
    d:\qt\6.0.0\src\qtbase\include\qtcore../../src/corelib/text/qregularexpression.h(124): error C2270: 'match'ÿ: modificateurs non autoris‚s sur les fonctions non membres
    d:\qt\6.0.0\src\qtbase\include\qtcore../../src/corelib/text/qregularexpression.h(128): error C2061: erreur de syntaxeÿ: identificateur 'MatchType'
    d:\qt\6.0.0\src\qtbase\include\qtcore../../src/corelib/text/qregularexpression.h(129): error C2270: 'match'ÿ: modificateurs non autoris‚s sur les fonctions non membres
    d:\qt\6.0.0\src\qtbase\include\qtcore../../src/corelib/text/qregularexpression.h(133): error C2061: erreur de syntaxeÿ: identificateur 'MatchType'
    d:\qt\6.0.0\src\qtbase\include\qtcore../../src/corelib/text/qregularexpression.h(134): error C2270: 'globalMatch'ÿ: modificateurs non autoris‚s sur les fonctions non membres
    d:\qt\6.0.0\src\qtbase\include\qtcore../../src/corelib/text/qregularexpression.h(138): error C2061: erreur de syntaxeÿ: identificateur 'MatchType'
    d:\qt\6.0.0\src\qtbase\include\qtcore../../src/corelib/text/qregularexpression.h(139): error C2270: 'globalMatch'ÿ: modificateurs non autoris‚s sur les fonctions non membres
    d:\qt\6.0.0\src\qtbase\include\qtcore../../src/corelib/text/qregularexpression.h(141): error C2270: 'optimize'ÿ: modificateurs non autoris‚s sur les fonctions non membres
    d:\qt\6.0.0\src\qtbase\include\qtcore../../src/corelib/text/qregularexpression.h(152): error C2664: 'QString escape(const QString &)'ÿ: impossible de convertir l'argument 1 de 'QStringView' en 'const QString &'
    d:\qt\6.0.0\src\qtbase\include\qtcore../../src/corelib/text/qregularexpression.h(152): note: Raisonÿ: impossible de convertir de 'QStringView' en 'const QString'
    d:\qt\6.0.0\src\qtbase\include\qtcore../../src/corelib/text/qregularexpression.h(152): note: Aucun op‚rateur de conversion d‚finie par l'utilisateur disponible qui puisse effectuer cette conversion, ou l'op‚rateur ne peut pas ˆtre appel‚
    d:\qt\6.0.0\src\qtbase\include\qtcore../../src/corelib/text/qregularexpression.h(157): error C2664: 'QString wildcardToRegularExpression(const QString &,WildcardConversionOptions)'ÿ: impossible de convertir l'argument 1 de 'QStringView' en 'const QString &'
    d:\qt\6.0.0\src\qtbase\include\qtcore../../src/corelib/text/qregularexpression.h(157): note: Raisonÿ: impossible de convertir de 'QStringView' en 'const QString'
    d:\qt\6.0.0\src\qtbase\include\qtcore../../src/corelib/text/qregularexpression.h(157): note: Aucun op‚rateur de conversion d‚finie par l'utilisateur disponible qui puisse effectuer cette conversion, ou l'op‚rateur ne peut pas ˆtre appel‚
    d:\qt\6.0.0\src\qtbase\include\qtcore../../src/corelib/text/qregularexpression.h(162): error C2664: 'QString anchoredPattern(const QString &)'ÿ: impossible de convertir l'argument 1 de 'QStringView' en 'const QString &'
    d:\qt\6.0.0\src\qtbase\include\qtcore../../src/corelib/text/qregularexpression.h(162): note: Raisonÿ: impossible de convertir de 'QStringView' en 'const QString'
    d:\qt\6.0.0\src\qtbase\include\qtcore../../src/corelib/text/qregularexpression.h(162): note: Aucun op‚rateur de conversion d‚finie par l'utilisateur disponible qui puisse effectuer cette conversion, ou l'op‚rateur ne peut pas ˆtre appel‚
    d:\qt\6.0.0\src\qtbase\include\qtcore../../src/corelib/text/qregularexpression.h(173): error C2270: '=='ÿ: modificateurs non autoris‚s sur les fonctions non membres
    d:\qt\6.0.0\src\qtbase\include\qtcore../../src/corelib/text/qregularexpression.h(173): error C2805: nombre de paramŠtres insuffisant pour l'op‚rateur binaire 'operator =='
    d:\qt\6.0.0\src\qtbase\include\qtcore../../src/corelib/text/qregularexpression.h(174): error C2270: '!='ÿ: modificateurs non autoris‚s sur les fonctions non membres
    d:\qt\6.0.0\src\qtbase\include\qtcore../../src/corelib/text/qregularexpression.h(174): error C2805: nombre de paramŠtres insuffisant pour l'op‚rateur binaire 'operator !='
    d:\qt\6.0.0\src\qtbase\include\qtcore../../src/corelib/text/qregularexpression.h(174): error C2264: 'operator =='ÿ: erreur dans la d‚finition ou la d‚claration de la fonctionÿ; fonction non appel‚e
    d:\qt\6.0.0\src\qtbase\include\qtcore../../src/corelib/text/qregularexpression.h(176): error C2059: erreur de syntaxeÿ: 'private'
    d:\qt\6.0.0\src\qtbase\include\qtcore../../src/corelib/text/qregularexpression.h(177): error C2255: 'friend'ÿ: non autoris‚ en dehors d'une d‚finition de classe
    d:\qt\6.0.0\src\qtbase\include\qtcore../../src/corelib/text/qregularexpression.h(178): error C2255: 'friend'ÿ: non autoris‚ en dehors d'une d‚finition de classe
    d:\qt\6.0.0\src\qtbase\include\qtcore../../src/corelib/text/qregularexpression.h(179): error C2255: 'friend'ÿ: non autoris‚ en dehors d'une d‚finition de classe
    d:\qt\6.0.0\src\qtbase\include\qtcore../../src/corelib/text/qregularexpression.h(180): error C2255: 'friend'ÿ: non autoris‚ en dehors d'une d‚finition de classe
    d:\qt\6.0.0\src\qtbase\include\qtcore../../src/corelib/text/qregularexpression.h(181): error C2255: 'friend'ÿ: non autoris‚ en dehors d'une d‚finition de classe
    d:\qt\6.0.0\src\qtbase\include\qtcore../../src/corelib/text/qregularexpression.h(183): error C2143: erreur de syntaxeÿ: absence de ')' avant '&'
    d:\qt\6.0.0\src\qtbase\include\qtcore../../src/corelib/text/qregularexpression.h(183): error C2143: erreur de syntaxeÿ: absence de ';' avant '&'
    d:\qt\6.0.0\src\qtbase\include\qtcore../../src/corelib/text/qregularexpression.h(183): error C2059: erreur de syntaxeÿ: ')'
    d:\qt\6.0.0\src\qtbase\include\qtcore../../src/corelib/text/qregularexpression.h(183): error C4430: sp‚cificateur de type manquant - int est pris en compte par d‚faut. Remarqueÿ: C++ ne prend pas en charge int par d‚faut
    ninja: build stopped: subcommand failed.


  • Lifetime Qt Champion

    @Sylvanus said in How to Create Qt6 version for MSVC2017:

    it seems to be technicaly possible to use Qt6 with MSVC2017

    I can't tell you for sure, but hopefully it is.

    32bit Qt versions are not provided by Qt Company anymore, so you will have to build Qt by yourself for 32bit.


  • Lifetime Qt Champion

    @Sylvanus One more thing: for 64bit you should try the official binaries provided by Qt Company instead of building it by yourself.



  • Hi jsulm.
    thanks for your help.
    For 64bit version you are absolutely right. No need to make jobs twice ! (except to know how to do it once !!)

    But the use of 64bit version seems to issue dependancy and compatibility with others lib !
    it is little bit tricky for me

    That's why i need to obtain 32bit version and lateste version are not provided by the Qt Company. I need to do this by myself.
    I will try to test it with Qt5.15.2 and MSVC2017.
    If you have some inforamtions, tuto, help about that. Enjoy to share it !!


  • Lifetime Qt Champion



  • Nice !
    I will have a look on it
    We stay in touch



  • Hi jsulm

    I am back to you with latest news
    I have successfully compiled Qt5.15.2 for both x86 and x64 targets on MSVC2017
    I am compiling Qt5.15.2 for both x86 and x64 targets on MSVC2019. In progress .... very long time consumption !

    You are right, some of that releases already exist and are provided by QtCompany itself but it was a good job just to well understanding each steps and traps !

    right now i am pretty ready to start qt6.0.0 compilation.

    back to you once done !

    if someoneelse need some informations just ask

    stay in touch


Log in to reply