Page 2 of 2 FirstFirst 12
Results 21 to 24 of 24

Thread: INCLUDEPATH how it works ?

  1. #21
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,368
    Thanks
    3
    Thanked 5,018 Times in 4,794 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: INCLUDEPATH how it works ?

    Using custom widgets "using promoting approach" is no different than using them directly in hand-written C++ code. You always need to add the header and implementation file (provided they exist) to the project.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  2. #22
    Join Date
    Mar 2009
    Location
    Brisbane, Australia
    Posts
    7,729
    Thanks
    13
    Thanked 1,610 Times in 1,537 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows
    Wiki edits
    17

    Default Re: INCLUDEPATH how it works ?

    Quote Originally Posted by tonnot View Post
    INCLUDEPATH
    This variable specifies the #include directories which should be searched when compiling the project. Use ';' or a space as the directory separator.
    Notice the words "when compiling the project". That is to say, the paths are sent to the C++ compiler as -I options or their equivalent. There a literally hundreds of include files involved in compiling your project, many (most) of which have nothing directly relating them to Qt. Qt does not assume that every possible include file is part of your project and does not scan every one of these files for the Q_OBJECT or other markers that trigger Qt code generation. Qmake uses the HEADERS variable to identify files that are part of your project and should be scanned for pre-processing triggers and, when found, generate and compile extra C++ source on your behalf.

    In your case the C++ compiler is finding everything it needs to compile the project. The linker fails because code that is generated on your behalf has not been generated and included in the compilation, i.e. HEADERS is wrong.

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

    tonnot (29th October 2010)

  4. #23
    Join Date
    Sep 2010
    Posts
    654
    Thanks
    56
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: INCLUDEPATH how it works ?

    I understand your explanation.
    At end, Is there any way to say QT that must investigate for Q_Object and other markes ?
    Thanks

  5. #24
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,368
    Thanks
    3
    Thanked 5,018 Times in 4,794 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: INCLUDEPATH how it works ?

    Quote Originally Posted by tonnot View Post
    I understand your explanation.
    At end, Is there any way to say QT that must investigate for Q_Object and other markes ?
    Thanks
    Read this sentence again:
    The linker fails because code that is generated on your behalf has not been generated and included in the compilation, i.e. HEADERS is wrong.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


Similar Threads

  1. Creator 4.5.2 crash adding INCLUDEPATH
    By PUK_999 in forum Newbie
    Replies: 11
    Last Post: 17th August 2009, 20:38
  2. Replies: 1
    Last Post: 2nd December 2008, 11:31
  3. another qmake INCLUDEPATH spaces problem
    By mmueller in forum Qt Programming
    Replies: 4
    Last Post: 31st July 2008, 14:12
  4. qmake multiple INCLUDEPATH in Linux
    By rajeshs in forum Qt Programming
    Replies: 12
    Last Post: 15th November 2007, 10:38
  5. qmake INCLUDEPATH with spaces
    By bitChanger in forum Qt Programming
    Replies: 8
    Last Post: 28th April 2006, 05:39

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
  •  
Qt is a trademark of The Qt Company.