Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Qt Creator and other tools
  4. Qt 5.10.1. Clang Code Model: suddenly marks 'std' as undefined identifier.

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

Scheduled Pinned Locked Moved Solved Qt Creator and other tools
8 Posts 3 Posters 4.9k Views
  • 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 Offline
    M Offline
    master_clown
    wrote on last edited by master_clown
    #1

    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
    0
    • M Offline
      M Offline
      master_clown
      wrote on last edited by master_clown
      #8

      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
      2
      • M 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 Offline
        A Offline
        ambershark
        wrote on last edited by
        #2

        @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
        1
        • M Offline
          M Offline
          master_clown
          wrote on last edited by
          #3
          This post is deleted!
          1 Reply Last reply
          0
          • A ambershark

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

            M Offline
            M Offline
            master_clown
            wrote on last edited by
            #4

            @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
            0
            • A ambershark

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

              M Offline
              M Offline
              master_clown
              wrote on last edited by
              #5

              @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_1980A 1 Reply Last reply
              0
              • M master_clown

                @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_1980A Offline
                aha_1980A Offline
                aha_1980
                Lifetime Qt Champion
                wrote on last edited by
                #6

                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
                0
                • aha_1980A aha_1980

                  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.

                  M Offline
                  M Offline
                  master_clown
                  wrote on last edited by
                  #7

                  @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
                  0
                  • M Offline
                    M Offline
                    master_clown
                    wrote on last edited by master_clown
                    #8

                    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
                    2

                    • Login

                    • Login or register to search.
                    • First post
                      Last post
                    0
                    • Categories
                    • Recent
                    • Tags
                    • Popular
                    • Users
                    • Groups
                    • Search
                    • Get Qt Extensions
                    • Unsolved