Qt 5.10.1. Clang Code Model: suddenly marks 'std' as undefined identifier.

  • I have just installed Qt and created a C++ project. Exactly after opening a file, everything is fine:

    But after editing the file (it could be whatever, the point is the file is now supposed to be edited by the IDE), every use of 'std' is labeled as an error:

    It's been happening with Qt 5.10.0 either, but 3 months ago there was no problem, with 5.9, if not much mistaken. I hoped reinstalling of Qt (and potential upgrade to 5.10.1) will do the thing, but it did not. Now I can't go on with my work in convenient way, because CCM is making Qt Creator almost equal to Visual Studio and much more pleasant to work with for me.

    I've been asking in other places about it, no one had seen it before. Maybe it's something to do with my installation? If so, reinstalling Qt hasn't solved it. Maybe there is some kind of cache for CCM, which is required to be wiped out manually?

    Compiler: VC++ 15.0 (2017)

  • Moderators

    @master_clown Just out of curiosity does it flag std::cout as unknown too?

    It looks like your tags are messed up like maybe it can't find the header files for your standard c++. More than likely this would be caused by a compiler upgrade not a Qt one.

  • This post is deleted!

  • @ambershark, as you see for 'cin' and 'endl', yes, it does. So you think the solution is to reinstall Visual Studio?

  • @ambershark, just reinstalled it, didn't work. It compiles for good, if that's not clear. The problem is only in those error labels all over the code.

  • Qt Champions 2018

    Hi @master_clown

    please see https://wiki.qt.io/Qt_Creator_Clang_Code_Model how to generate additional debug output. You can paste that here if you find something weird. It will also help if you need to generate a bugreport.


  • @aha_1980, Hello. There are tons and tons of warning messages, which are related to compiler/WinSDK headers:

    That's interesting, but with this debug output mode turned on, everything in QtCreator goes fine, except that autocompletion works only with preprocessor directives (gives a hint for include files, for example). And leaving a erroneous statement ("obj. = 12;", or whatever) makes clang "blink" with a respective warning/error label (shows and disappears consequently).

  • The problem is solved: QtCreator 4.5.x has had malfunctioning LLVM Clang. Now I'm using 4.6.0-beta, though, as I think, to make it work on 4.5, one should replace libclang.dll in QtCreator-dir/bin with a version from 4.6.0, or from Clang 6.0.0 build.

    I should apologize, because only now I've noticed repeating messages about clangbackend process crash and restart, though, I'm sure there was nothing when I'd been starting the topic. Only because of it I found the solution.

Log in to reply

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.