Results 1 to 1 of 1

Thread: Precompiled header with both C and C++ files

  1. #1
    Join Date
    Apr 2015
    Posts
    4
    Qt products
    Qt4
    Platforms
    Windows

    Default Precompiled header with both C and C++ files

    Hello. To illustrate the issue I'm facing, I created the following simple project:

    Qt Code:
    1. TEMPLATE = app
    2. CONFIG += console
    3. CONFIG -= app_bundle
    4. CONFIG -= qt
    5.  
    6. CONFIG += precompile_header
    7. PRECOMPILED_HEADER = testpch.h
    8.  
    9. QMAKE_CC = $${QMAKE_CXX}
    10. QMAKE_CFLAGS += -TP
    11. QMAKE_CFLAGS += -EHsc
    12.  
    13. SOURCES += \
    14. main.cpp \
    15. extra.c
    16.  
    17. HEADERS += testpch.h
    To copy to clipboard, switch view to plain text mode 

    The problem is that extra.c is not compiled with the precompiled header, even though it is compiled as a C++ file. main.cpp has in its command line
    Qt Code:
    1. -FItestpch.h -Yutestpch.h -Fpdebug\testproject_pch.pch
    To copy to clipboard, switch view to plain text mode 
    , which is not present in the command line for extra.c. How can I determine qmake to introduce the precompiled header also in the case of C files?
    Last edited by Ermoghen; 22nd April 2015 at 15:38.

Similar Threads

  1. Qt header files suggestion
    By chandan in forum Newbie
    Replies: 3
    Last Post: 1st March 2011, 10:23
  2. Header Files
    By Maluko_Da_Tola in forum Newbie
    Replies: 1
    Last Post: 2nd October 2010, 12:04
  3. Replies: 2
    Last Post: 30th September 2010, 12:26
  4. header files problems
    By dognzhe in forum General Programming
    Replies: 1
    Last Post: 18th May 2009, 08:00
  5. header files not getting included
    By nimmyj in forum Installation and Deployment
    Replies: 1
    Last Post: 19th December 2006, 06:18

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.