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.
Forum Updated to NodeBB v4.3 + New Features

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 2 Watching
  • 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 7 Mar 2018, 15:52 last edited by master_clown 3 Jul 2018, 15:55
    #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 9 Mar 2018, 03:14
    0
    • M Offline
      M Offline
      master_clown
      wrote on 13 Mar 2018, 13:06 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
        7 Mar 2018, 15:52

        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 9 Mar 2018, 03:14 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 11 Mar 2018, 12:35
        1
        • M Offline
          M Offline
          master_clown
          wrote on 11 Mar 2018, 12:30 last edited by
          #3
          This post is deleted!
          1 Reply Last reply
          0
          • A ambershark
            9 Mar 2018, 03:14

            @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 11 Mar 2018, 12:35 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
              9 Mar 2018, 03:14

              @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 11 Mar 2018, 14:27 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.

              A 1 Reply Last reply 11 Mar 2018, 15:13
              0
              • M master_clown
                11 Mar 2018, 14:27

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

                A Offline
                A Offline
                aha_1980
                Lifetime Qt Champion
                wrote on 11 Mar 2018, 15:13 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 11 Mar 2018, 18:40
                0
                • A aha_1980
                  11 Mar 2018, 15:13

                  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 11 Mar 2018, 18:40 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 13 Mar 2018, 13:06 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

                    3/8

                    11 Mar 2018, 12:30

                    topic:navigator.unread, 5
                    • Login

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