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 Creator Clang Tools: can't analyze a header file
Forum Updated to NodeBB v4.3 + New Features

Qt Creator Clang Tools: can't analyze a header file

Scheduled Pinned Locked Moved Solved Qt Creator and other tools
4 Posts 2 Posters 828 Views 1 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.
  • B Offline
    B Offline
    bam80
    wrote on 31 Dec 2022, 13:05 last edited by
    #1

    It was reported https://bugreports.qt.io/browse/QTCREATORBUG-28638:

    Clang Tools analysis of a C(++) header is impossible with Qt Creator - the error is shown in Issues pane:

    :-1: error: Cannot analyze current file: "/home/bam/kde/src/kwin/src/main.h" is not a known source file.
    

    The same file can be analyzed with CLI Clang-Tidy just fine.

    Tried on CMake-based KWin project:
    https://invent.kde.org/plasma/kwin

    To reproduce:
    right-click on the header source, from the context menu choose Analyze Current File item

    1 Reply Last reply
    0
    • C Offline
      C Offline
      cristian-adam
      wrote on 31 Dec 2022, 17:40 last edited by
      #2

      Qt Creator requires header files to be part of target_sources. As you can see at src/CMakeLists.txt · master · Plasma / KWin · GitLab (kde.org) there is no main.h there, only the cpp file.

      See Qt Creator 6 - CMake update for more details.

      1 Reply Last reply
      2
      • B Offline
        B Offline
        bam80
        wrote on 6 Jan 2023, 11:20 last edited by
        #3

        Thank you.
        I provided a KWin patch to address this, let's see what colleagues say:
        https://invent.kde.org/plasma/kwin/-/merge_requests/3400

        1 Reply Last reply
        1
        • B Offline
          B Offline
          bam80
          wrote on 7 Jan 2023, 17:26 last edited by
          #4

          So as you can see from the MR threads above, I'm not sure if that header addition will be eventually happen - to much work to add all of them.

          So it might be solving it on Qt Creator side is still needed, in a common case.. :(

          1 Reply Last reply
          0

          1/4

          31 Dec 2022, 13:05

          • Login

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