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

implicit #include statement

Scheduled Pinned Locked Moved Unsolved Qt Creator and other tools
4 Posts 2 Posters 467 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.
  • mzimmersM Offline
    mzimmersM Offline
    mzimmers
    wrote on last edited by
    #1

    Hi all -

    A co-worker of mine asked whether Creator had the ability to include a given header file implicitly (with no #include statement in the code). This would be of use when using Creator as an editor/code browser for cross development purposes. The target uses cmake and menuconfig; it would be convenient to be able to implicitly include the sckconfig.h file that menuconfig creates, to eliminate spurious errors in Creator's editor.

    Any ideas?

    1 Reply Last reply
    0
    • mrjjM Offline
      mrjjM Offline
      mrjj
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi
      Do you mean as include for the clang code completion?
      OR as a normal include for the code itself so the Creator should pretend that
      any .h or .cpp file had a #include " sckconfig.h"

      Creator does support cmake so its not possible to use that directly ?

      It sounds that you dont compile in creator so I wonder if they error you see are "just"
      from the code model plugin showing error/warnings in the side bar?

      1 Reply Last reply
      1
      • mzimmersM Offline
        mzimmersM Offline
        mzimmers
        wrote on last edited by
        #3

        Hi mrjj -

        The goal is to eliminate the warnings I see in the editor. You're right that I don't actually build from Creator (though I'd love to), so it's mostly an annoyance, though it will also help me in following symbols to their origins.

        mrjjM 1 Reply Last reply
        0
        • mzimmersM mzimmers

          Hi mrjj -

          The goal is to eliminate the warnings I see in the editor. You're right that I don't actually build from Creator (though I'd love to), so it's mostly an annoyance, though it will also help me in following symbols to their origins.

          mrjjM Offline
          mrjjM Offline
          mrjj
          Lifetime Qt Champion
          wrote on last edited by mrjj
          #4

          @mzimmers
          Ok, i assume you are using the clang code model and its those errors you see then.
          I fully understand why you want it.

          If you look at
          https://doc.qt.io/qtcreator/creator-clang-codemodel.html
          and section
          Using Compilation Databases

          I tried enabling the
          Compilation Database Project Manager (plugin) and run the Generate Database from the build menu.
          It said
          Clang compilation database generated at "xxxDebug\compile_commands.json".

          I was wondering if we somehow can add your file to this database and Creator could use the symbol from it.

          Not that i ever tried this :)

          1 Reply Last reply
          0

          • Login

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