+ Reply to Thread
Results 1 to 2 of 2

Thread: QMake's INCLUDEPATH and DEPENDPATH problems.

  1. #1
    Join Date
    Aug 2008
    Posts
    124
    Thanks
    21
    Thanked 1 Time in 1 Post

    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
    Tampere, Finland
    Posts
    6,264
    Thanks
    36
    Thanked 1,479 Times in 1,374 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows Symbian S60 Maemo

    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

+ Reply to Thread

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