Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Include Path for Headers in QT?
Forum Updated to NodeBB v4.3 + New Features

Include Path for Headers in QT?

Scheduled Pinned Locked Moved General and Desktop
2 Posts 2 Posters 1.8k 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.
  • H Offline
    H Offline
    hhung
    wrote on last edited by
    #1

    Hi,

    In my .pro file for my project, I have an INCLUDEPATH parameters specified to include a set of headers (let's called them 1.h, 2.h, 3.h, etc.). I store them in a shared directory called /shared/projectfolder/include/project, and my INCLUDEPATH in the pro file is:

    INCLUDEPATH += /shared/projectfolder/include

    However, I also have the same headers 1.h, 2.h, and 3.h in my home directory (~/projectarchive/projectiteration/include/1.h, 2.h, 3.h, etc.), and when I try to create my QT project, instead of picking up the correct headers from /shared/projectfolder/include, it keeps looking at the ones in my home directory. Can anyone suggest why this might be happening?

    Regards,
    hhung

    1 Reply Last reply
    0
    • A Offline
      A Offline
      alasdairhatfield
      wrote on last edited by
      #2

      Hi,

      Try looking at the compilation output (not the issues). Dig down to the exact options with which the compiler ??g++?? is being executed. You will probably find that the

      bq. -I (minus sign, capital i)

      option appears a couple of times.

      The compiler (most compilers) walks through these in the order given until it finds the header it is looking for and it doesn't look any further - doesn't need to, its happy.

      If this doesn't bring anything, look at the compiler defaults. These may lead to the headers in your home directory being found first.

      If this is the case, options might be:
      Ask yourself why you have two copies of the same header
      Change the name of the headers
      Change the compilation settings in the project configurations / make files.

      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