Results 1 to 20 of 26

Thread: How to force include a header file

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #5
    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: How to force include a header file

    Quote Originally Posted by rawfool View Post
    I'm using MinGW 4.7 and when I do QMAKE_CXXFLAGS += /FI"customTypes.h", it's saying, error: No such file or directory.
    But I've included that header file path in INCLUDEPATH.
    What do I do now? Thank you for the reply.
    It may have helped to have mentioned that you were not using the Microsoft compiler. As it stands at the moment the compiler is probably complaining because there is no file called literally '/FI"customtypes.h"': even cursory inspection of existing command lines or the manual would have highlighted that "/" does not introduce a command line switch to GCC.

    GCC has an equivalent switch that can be found with less than three minutes and the GCC manual:
    Qt Code:
    1. -include "someobscurefilethatisboundtobelost.h"
    To copy to clipboard, switch view to plain text mode 
    Make sure read about where the compiler will be looking for someobscurefilethatisboundtobelost.h.

    The correct approach is to fix your source code, not to try and fudge it with obscure compiler options.

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

    rawfool (21st May 2013)

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