Results 1 to 2 of 2

Thread: QMake's INCLUDEPATH and DEPENDPATH problems.

  1. #1
    Join Date
    Aug 2008
    Posts
    132
    Thanks
    23
    Thanked 3 Times in 3 Posts

    Default QMake's INCLUDEPATH and DEPENDPATH problems.

    Hi

    After using Qt for about 4 months now, I decided to understand the INCLUDEPATH and DEPENDPATH qmake options completely, since I end up with include type errors more than often:

    From the documentation:
    DEPENDPATH

    This variable contains the list of all directories to look in to resolve dependencies. This will be used when crawling through included files.

    INCLUDEPATH

    This variable specifies the #include directories which should be searched when compiling the project. Use ';' or a space as the directory separator.

    Two questions:
    1) Can someone please explain this better. INCLUDEPATH will be used during compilation, and DEPENDPATH during linking? Is this correct?
    2) The paths included using these commands are relative to which directories? If I, for example have something like this: INCLUDEPATH += ./../../Framework. Will this be relative to the directory in which the .pro file is sitting? Or relative to every file in my project?

    At the moment for example I'm sitting with the following problem which I don't understand. I have:
    INCLUDEPATH += ../../../Framework/Headers/Variables \

    and in one of the file included in the library generated by this .pro file I have:
    #include <Variable.h>
    which is in the above directory.

    Why doesn't work? I get:
    source\DataComponentStructs.h:9:22: Variable.h: No such file or directory

    Please give some guidance,
    Thanks
    Jaco

  2. #2
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    6,264
    Thanks
    36
    Thanked 1,519 Times in 1,389 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows Symbian S60 Maemo/MeeGo

    Default Re: QMake's INCLUDEPATH and DEPENDPATH problems.

    INCLUDEPATH is used during compilation to find included header files. DEPENDPATH is used to resolve dependencies between header and source files, eg. which source files need to be recompiled when certain header file changes. If you modify a header file in folder foo/ and foo/ is not listed in DEPENDPATH, nothing gets recompiled. If foo/ is listed in DEPENDPATH, source files depending on that header will get recompiled. Paths can be relative to the .pro file or absolute paths.
    J-P Nurmi

  3. The following user says thank you to jpn for this useful post:

    ravas (20th February 2016)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.