Results 1 to 2 of 2

Thread: preprocessor output

  1. #1
    Join Date
    Dec 2010
    Posts
    1
    Qt products
    Qt4
    Platforms
    Windows

    Default preprocessor output

    How do I generate preprocessor output on qt Creator ?

    the standard -E option for mingw32 doesn't work.

    thanks

  2. #2
    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: preprocessor output

    The -E option for gcc/g++ and does work quite happily in the MingW GCC compiler.

    Adding -E to the QMAKE_CFLAGS and QMAKE_CXXFLAGS varaibles adds the -E option to the compiler calls. Something like:
    Qt Code:
    1. QMAKE_CFLAGS = $$QMAKE_CFLAGS -E
    2. QMAKE_CXXFLAGS = $$QMAKE_CXXFLAGS -E
    To copy to clipboard, switch view to plain text mode 
    However, the way that the Makefile is written by qmake means that two things will happen:
    • The preprocessed output will be captured into the object (.o) file
    • The link will fail because the object file is actually a text file

Similar Threads

  1. Replies: 3
    Last Post: 15th November 2010, 07:53
  2. A question on preprocessor
    By Dante in forum Qt Programming
    Replies: 1
    Last Post: 9th July 2009, 22:28
  3. custom preprocessor?
    By magland in forum Qt Programming
    Replies: 17
    Last Post: 20th October 2007, 12:17
  4. Qt4 Preprocessor defines
    By Chicken Blood Machine in forum Qt Programming
    Replies: 12
    Last Post: 23rd March 2006, 16:28
  5. QT & VC++ 8 preprocessor setting
    By Ngoc in forum Qt Programming
    Replies: 0
    Last Post: 3rd March 2006, 20:40

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.