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

Default Include Path and using INCLUDEPATH

Scheduled Pinned Locked Moved Unsolved Qt Creator and other tools
3 Posts 2 Posters 3.9k 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.
  • S Offline
    S Offline
    stryker
    wrote on 11 Jan 2017, 19:16 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

    K 1 Reply Last reply 11 Jan 2017, 19:34
    0
    • S stryker
      11 Jan 2017, 19:16

      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

      K Offline
      K Offline
      kshegunov
      Moderators
      wrote on 11 Jan 2017, 19:34 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 11 Jan 2017, 20:14 last edited by
        #3

        Thanks, appreciate the quick reply.

        1 Reply Last reply
        0

        1/3

        11 Jan 2017, 19:16

        • Login

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