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 include paths

Qt Creator include paths

Scheduled Pinned Locked Moved Unsolved Qt Creator and other tools
5 Posts 3 Posters 2.1k 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.
  • P Offline
    P Offline
    paulf
    wrote on last edited by
    #1

    I'm a bit fed up with getting Creator to find blindingly obvious include paths. Two examples of this:

    • At work, on RHEl 6.5 (yes, I know),we have a fairly huge old codebase, built with heavily hacked CMake scripts that I've not managed to get Creator to swallow. We use a homwbrew build of GCC 5.3.0 that is on some NFS mount. I create projects using Import Existing Project. Then I get a lot of code model problems because none of the standard C headers in /usr/include can be found. I would expect that 99.9% of the time that is where they are.

    • At (WF) home, I just tried a small example on FreeBSD using #include <boost/bimap.hpp>, Again code model can't find it. Maybe this is a problem in the FreeBSD port, but it really should be looking in /usr/local/include which is where additional package headers get installed.

    What can I do to fix these trivial cases?

    1 Reply Last reply
    0
    • kkoehneK Offline
      kkoehneK Offline
      kkoehne
      Moderators
      wrote on last edited by
      #2

      @paulf said in Qt Creator include paths:

      What can I do to fix these trivial cases?

      Qt Creator code model retrieves its default include paths from various sources:

      • Compiler defaults
      • Project configuration
      • Environment

      So please check whether you've configured the right compiler for your current kit (and the compiler actually have the paths you mention baked into it).

      If this fails, you can also tell Qt Creator directly to use certain include paths by changing the <project>.includes file that's created if you use the 'Import Existing Project' wizard.

      Director R&D, The Qt Company

      P 1 Reply Last reply
      0
      • kkoehneK kkoehne

        @paulf said in Qt Creator include paths:

        What can I do to fix these trivial cases?

        Qt Creator code model retrieves its default include paths from various sources:

        • Compiler defaults
        • Project configuration
        • Environment

        So please check whether you've configured the right compiler for your current kit (and the compiler actually have the paths you mention baked into it).

        If this fails, you can also tell Qt Creator directly to use certain include paths by changing the <project>.includes file that's created if you use the 'Import Existing Project' wizard.

        P Offline
        P Offline
        paulf
        wrote on last edited by paulf
        #3

        None of that seems to work. The compiler picks up headers in /usr/include. I don't know how Creator is supposed to be deducing this. This is an "Import External Project", so there is no project configuration. I tried adding "/usr/include" to the end of the .includes file and again that made no difference.

        Could this be an IWYU problem? The file that I'm looking at right now is a C++ file with all the C str* functions redlined. The file does not include <string.h> directly. Is the parser not reading all of the include files?

        P 1 Reply Last reply
        0
        • P paulf

          None of that seems to work. The compiler picks up headers in /usr/include. I don't know how Creator is supposed to be deducing this. This is an "Import External Project", so there is no project configuration. I tried adding "/usr/include" to the end of the .includes file and again that made no difference.

          Could this be an IWYU problem? The file that I'm looking at right now is a C++ file with all the C str* functions redlined. The file does not include <string.h> directly. Is the parser not reading all of the include files?

          P Offline
          P Offline
          paulf
          wrote on last edited by paulf
          #4

          Well, we've upgraded to RHEL 7.6 and I'm now able to easily upgrade to the latest Qt Creator.

          I still have this problem, and another colleague has also been complaining about it.

          However, I just did some poking around and I found one of the problems. Somewhere in the project there is a string.h that has nothing to do with the C header. However this is getting picked up instead of /usr/include/string.h. If I remove this directory from 'project.includes' then I have fewer problems.

          1 Reply Last reply
          1
          • F Offline
            F Offline
            fahad64
            wrote on last edited by
            #5

            Hi all, I was recently facing include std and stl missing issues. And

            It seems like Qt Creator 4.15.1 is conflicting with it's default configured kits.

            So I have made a custom one by:

            • I have installed clang 10 from ubuntu.
            • sudo apt install clang
            • tools>options>Kits>Kits
            • select the default Desktop QT 5.15.2 64 bit (default)
            • Press Clone button
            • In compiler section
            • For C : Clang 10(C, x86 64bit in /usr/bin)
            • For c++ Clang 10(C++, x86 64bit in /usr/bin)

            Using this kit cmake and Qmake is working and also missing stl and std paths are fixed.

            https://askubuntu.com/a/1348022/225382

            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