Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

Unexpected compiler version, expected Clang 9.0.0 or newer



  • Hello,
    I installed Qt Creator 4.12.0 the latest and using the kits Desktop Qt 5.14.2 MSVC2017 64bit (default)
    I got a warning message in my mainwindow.cpp as follows:

    
    ..
    Warning: The code model could not parse an included file, which might lead to incorrect code completion and highlighting, for example.
    yvals_core.h:435:2: error: STL1000: Unexpected compiler version, expected Clang 9.0.0 or newer
    
    mainwindow.cpp:1:1: note: in file included from C:\Qt_Projects\HelloWorld\mainwindow.cpp:1:
    mainwindow.cpp:1:10: note: in file included from C:\Qt_Projects\HelloWorld\mainwindow.cpp:1:
    mainwindow.h:4:10: note: in file included from C:\Qt_Projects\HelloWorld\mainwindow.h:4:
    QMainWindow:1:10: note: in file included from C:\Qt\5.14.2\msvc2017_64\include\QtWidgets\QMainWindow:1:
    qmainwindow.h:43:10: note: in file included from C:\Qt\5.14.2\msvc2017_64\include\QtWidgets\qmainwindow.h:43:
    qtwidgetsglobal.h:43:10: note: in file included from C:\Qt\5.14.2\msvc2017_64\include\QtWidgets\qtwidgetsglobal.h:43:
    qtguiglobal.h:43:10: note: in file included from C:\Qt\5.14.2\msvc2017_64\include\QtGui\qtguiglobal.h:43:
    qglobal.h:45:12: note: in file included from C:\Qt\5.14.2\msvc2017_64\include\QtCore\qglobal.h:45:
    type_traits:9:10: note: in file included from C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.25.28610\include\type_traits:9:
    
    ..
    

    I have Microsoft Visual Studio Community 2019, Version 16.5.4 and i have installed the Clang 11.0.0 from IntelSW Tools.

    Anyone has idea how to remove that warning? Thank you

    Maya


  • Lifetime Qt Champion

    @D-Maya said in Unexpected compiler version, expected Clang 9.0.0 or newer:

    Warning: The code model could not parse an included file, which might lead to incorrect code completion and highlighting, for example.
    yvals_core.h:435:2: error: STL1000: Unexpected compiler version, expected Clang 9.0.0 or newer

    This is coming from code model. Since you installed Clang by yourself it is probably conflicting with the one from QtCreator. Is your Clang bin directory in PATH?



  • Yes I have added to path the Clang.

    C:\Program Files (x86)\IntelSWTools\compilers_and_libraries_2020.1.216\windows\lib\clang\11.0.0\include
    

    Clang comes with the Intel Software Tools package, Clang version 11.0.0


  • Lifetime Qt Champion

    @D-Maya Try to remove your Clang from PATH and see whether it helps.
    Also, this path looks like the folder with header files, not clang executable: C:\Program Files (x86)\IntelSWTools\compilers_and_libraries_2020.1.216\windows\lib\clang\11.0.0\include



  • @jsulm I have deleted it from the path but didn't help.
    I also tried to add to path

    C:\Qt\Tools\QtCreator\bin\clang\bin
    

    but still getting the same warning.. strange..



  • Hello,
    I have the exact same problem, using Qt Creator 4.12, with Qt 5.14.2.
    I installed prebuild Qt with MSVC2017 64bit on Windows. I then replaced the compiler with the latest MSVC 2019 from Visual Studio Build Tools 2019 (MSVC 2017 and 2019 are binary compatible) which was working fine previously. I built Clang myself but it is not in the PATH.
    I suspect the error is related to this bug report.

    The error started happenning after one of the last updates.
    The compiler configuration:
    compiler configuration
    The Kit configuration:
    kit configuration
    The error message itself:
    error message

    I can provide any missing information or a minimal reproducible example if needed (any new Qt project with that kit).

    Thank you in advance for any help,
    Haellsigh



  • Hello,

    Problem still continues, i have installed Qt Creator 4.12.1 based on Qt5.14.2 and still getting the same warning if I use the MSVC Kit.

    Warning: The code model could not parse an included file, which might lead to incorrect code completion and highlighting, for example.
    
    yvals_core.h:462:2: error: STL1000: Unexpected compiler version, expected Clang 9.0.0 or newer.
    main.cpp:1:1: note: in file included from C:\Qt\Examples\Qt-5.15.0\gui\analogclock\main.cpp:1:
    main.cpp:51:10: note: in file included from C:\Qt\Examples\Qt-5.15.0\gui\analogclock\main.cpp:51:
    QtGui:3:10: note: in file included from C:\Qt\5.15.0\msvc2019_64\include\QtGui\QtGui:3:
    QtGuiDepends:3:10: note: in file included from C:\Qt\5.15.0\msvc2019_64\include\QtGui\QtGuiDepends:3:
    QtCore:4:10: note: in file included from C:\Qt\5.15.0\msvc2019_64\include\QtCore\QtCore:4:
    qglobal.h:45:12: note: in file included from C:\Qt\5.15.0\msvc2019_64\include\QtCore\qglobal.h:45:
    type_traits:9:10: note: in file included from C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.26.28801\include\type_traits:9:
    
    

    Any suggestions ?

    Thank you



  • @D-Maya So the bug is known (see here) and it's caused by the old Clang version used (8.0).
    Someone built Qt Creator with Clang 10 in the last comment on this issue. Just download one of the non-dev artifacts and put it in your Qt/Tools folder like here: 6eb46b1f-75cb-4020-87b2-d3fb468a210b-image.png
    Run qtcreator in the bin directory and it should now work.



  • @Haellsigh Thank you for the link
    I also downloaded QtCreator-Windows-MSVC-73516212.7z from the link, unzipped and pasted it under C:\Qt\Tools
    Clang warning disappears with this build.
    I hope incoming Qt Creator versions from Qt Company will include updated Clang version.
    Now I switch this topic to Closed.



  • I have this same problem on Qt Creator 4.12.2 (From revision 33c5ff216a) but I don't have Clang anywhere on my system, other than the distribution that comes with Qt. I am using Qt 5.15.0 with MSVC2019.

    It doesn't seem like there is a way to download the linked beta build any longer as the listed artifacts are not in anyway hyperlinked, though perhaps you have to go somewhere else that I'm missing.

    I was using Qt 5.14.3 with MSVC2019 on another system without issue but it hasn't been updated in a while so I guess the 16.5 update was the issue.

    I'm guessing that even though it has been a bit since this issue was posted that the latest official version of Qt Creator still using Clang 8.0.

    Is there another link to that beta build that anyone has?

    EDIT:

    Never mind, I eventually correctly guessed that you have to be logged into github in order to download artifacts from these builds for whatever reason.

    Using this build also fixed the issue for me.


Log in to reply