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. Default Include Path and using INCLUDEPATH
QtWS25 Last Chance

Default Include Path and using INCLUDEPATH

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

    Hi,

    I've been trying to add paths to search for headers using the INCLUDEPATH in the .pro file. I understand "INCLUDEPATH += /some/directory" appends to the include paths searched, but from what I am seeing in my project, the path I append is searched before the default ones.

    For example, I have "#include <default.h>" which is found in the default paths checked without adding any new paths, but also have "#include <someother.h>", which is not found in the default paths. When I use INCLUDEPATH and append a new directory path, both default.h and someother.h are found in the newly appended directory. I expected the default.h to still be used from the default path though. Am I misunderstanding how the include paths are searched when new ones are appended?

    Also, what are the default include paths or where are they defined in QT?

    Thanks

    kshegunovK 1 Reply Last reply
    0
    • S stryker

      Hi,

      I've been trying to add paths to search for headers using the INCLUDEPATH in the .pro file. I understand "INCLUDEPATH += /some/directory" appends to the include paths searched, but from what I am seeing in my project, the path I append is searched before the default ones.

      For example, I have "#include <default.h>" which is found in the default paths checked without adding any new paths, but also have "#include <someother.h>", which is not found in the default paths. When I use INCLUDEPATH and append a new directory path, both default.h and someother.h are found in the newly appended directory. I expected the default.h to still be used from the default path though. Am I misunderstanding how the include paths are searched when new ones are appended?

      Also, what are the default include paths or where are they defined in QT?

      Thanks

      kshegunovK Offline
      kshegunovK Offline
      kshegunov
      Moderators
      wrote on last edited by
      #2

      @stryker said in Default Include Path and using INCLUDEPATH:

      Am I misunderstanding how the include paths are searched when new ones are appended?

      No, it's correct, but this is also expected. Otherwise in no way you could use a header with the same name as the default.

      Also, what are the default include paths or where are they defined in QT?

      The default include path is set by your compiler, the Qt include paths are set by qmake and are dependent on where you installed Qt itself, but follow the pattern: QTBASEPATH/include/MODULENAME.

      Read and abide by the Qt Code of Conduct

      1 Reply Last reply
      2
      • S Offline
        S Offline
        stryker
        wrote on last edited by
        #3

        Thanks, appreciate the quick reply.

        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