Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Unsolved

    Update: Forum Guidelines & Code of Conduct

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

    Tools
    3
    8
    3906
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • M
      master_clown last edited by master_clown

      I have just installed Qt and created a C++ project. Exactly after opening a file, everything is fine:
      0_1520436562935_243f1c09-b67d-4149-a668-0685db24ac63-image.png

      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:
      0_1520436688870_7a96205f-771b-4645-8167-80680fb963a6-image.png

      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)

      A 1 Reply Last reply Reply Quote 0
      • M
        master_clown last edited by master_clown

        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.

        1 Reply Last reply Reply Quote 2
        • A
          ambershark @master_clown last edited by

          @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.

          My L-GPL'd C++ Logger github.com/ambershark-mike/sharklog

          M 2 Replies Last reply Reply Quote 1
          • M
            master_clown last edited by

            This post is deleted!
            1 Reply Last reply Reply Quote 0
            • M
              master_clown @ambershark last edited by

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

              1 Reply Last reply Reply Quote 0
              • M
                master_clown @ambershark last edited by

                @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.

                aha_1980 1 Reply Last reply Reply Quote 0
                • aha_1980
                  aha_1980 Lifetime Qt Champion @master_clown last edited by

                  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.

                  Regards.

                  Qt has to stay free or it will die.

                  M 1 Reply Last reply Reply Quote 0
                  • M
                    master_clown @aha_1980 last edited by

                    @aha_1980, Hello. There are tons and tons of warning messages, which are related to compiler/WinSDK headers:
                    0_1520793060989_9c3810a3-3b87-4733-a551-b632418e0ec2-image.png

                    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).

                    1 Reply Last reply Reply Quote 0
                    • M
                      master_clown last edited by master_clown

                      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.

                      1 Reply Last reply Reply Quote 2
                      • First post
                        Last post