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

Thread: How to force include a header file

  1. #21
    Join Date
    Jan 2006
    Location
    Graz, Austria
    Posts
    8,416
    Thanks
    37
    Thanked 1,544 Times in 1,494 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: How to force include a header file

    INCLUDEPATH+= "D:\Qt1\bin\Filewalker\Filewalker\Filewalker1"
    That is now a different path than you had earlier.

    Anyway, just put the header into the same directory as the cpp file.

    Cheers,
    _

  2. #22
    Join Date
    Mar 2015
    Posts
    125
    Qt products
    Qt4 Qt5
    Platforms
    Windows

    Default Re: How to force include a header file

    The header is in the same directory as cpp file.
    why it is different path?


    Added after 1 14 minutes:


    So are there alternatives to make custom include to works?
    Last edited by artt; 13th December 2015 at 17:14.

  3. #23
    Join Date
    Jan 2006
    Location
    Graz, Austria
    Posts
    8,416
    Thanks
    37
    Thanked 1,544 Times in 1,494 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: How to force include a header file

    The header is in the same directory as cpp file.
    Then you don't need an include path, the same directory is always searched.

    why it is different path?
    Oh, I don't know, lets see, the first path you posted
    Qt Code:
    1. D:\Qt1\bin\Filewalker\Filewalker\File walker1
    To copy to clipboard, switch view to plain text mode 
    and then the one you posted later
    Qt Code:
    1. D:\Qt1\bin\Filewalker\Filewalker\Filewalker1
    To copy to clipboard, switch view to plain text mode 
    Look different to me.

    Cheers,
    _

  4. #24
    Join Date
    Mar 2015
    Posts
    125
    Qt products
    Qt4 Qt5
    Platforms
    Windows

    Default Re: How to force include a header file

    It was in the same directory since the very beginning, but I got such warning that I noted at start of my discussion in this topic. Maybe I wrongly created the .h file? How to save it corecctly in notepad?

  5. #25
    Join Date
    Jan 2006
    Location
    Graz, Austria
    Posts
    8,416
    Thanks
    37
    Thanked 1,544 Times in 1,494 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: How to force include a header file

    Notepad? Seriously?

    Have you checked that the file is actually named what you think it is named?
    Not something like Class.h.txt?

    I can only recommend to use any form of code editor, or at least a real text editor.

    Cheers,
    _

  6. #26
    Join Date
    Mar 2015
    Posts
    125
    Qt products
    Qt4 Qt5
    Platforms
    Windows

    Default Re: How to force include a header file

    Really after browsing in 7-zip I saw that Filewalker.h.txt is really such one - so after renaming to
    Filewalker.h it also showed the h-pictogram. Anyway when saving in notepad-I did not saved as textfile but as "allfiles", but I probably should also define encoding not unicode, but UTF-8.
    So I should guess so -- but in working folder it is seen as Filewalker.h and as I said it was not saved as text file.

Similar Threads

  1. Must I include each widget header with qt5?
    By aguayro in forum Newbie
    Replies: 8
    Last Post: 27th December 2012, 15:53
  2. Replies: 5
    Last Post: 16th January 2011, 15:19
  3. The header file 'mainwindow.h' doesn't include <QObject>.
    By nhs_0702 in forum Qt Programming
    Replies: 5
    Last Post: 14th May 2010, 17:02
  4. compile to arm+include header
    By nataly in forum Qt Programming
    Replies: 1
    Last Post: 8th November 2009, 12:59
  5. unable to include header file
    By sonia in forum Qt Programming
    Replies: 1
    Last Post: 10th July 2007, 08:56

Tags for this 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
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.