Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Strange behavior with precompiled header on Windows only
Forum Updated to NodeBB v4.3 + New Features

Strange behavior with precompiled header on Windows only

Scheduled Pinned Locked Moved General and Desktop
1 Posts 1 Posters 1.7k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • F Offline
    F Offline
    floatingWoods
    wrote on last edited by
    #1

    Hello,

    I noticed a strange or inconsistent behavior when using a precompiled header in my project (Windows/Mac/Linux application). I include the precompiled header like this in the project file:

    CONFIG += precompile_header
    PRECOMPILED_HEADER = sourceCode/precompiledHeader.h

    When compiling with GCC in MacOSX or Linux Ubuntu, it works fine.
    Under Windows, with MinGW, I eventually get following error message from the compiler (after a few minutes of compilation):

    cc1plus.exe:-1: error: error: release\precompiledHeader.h: No such file or directory
    cc1plus.exe:-1: error: error: one or more PCH files were found, but they were invalid
    cc1plus.exe:-1: error: error: use -Winvalid-pch for more information

    It is strange because I never specify the location of the precompiled header to be in "release" folder.
    After copy and pasting the precompiled header to the "release\release" folder, it compiles fine!
    So basically, if the precompiled file is missing from one of the two above locations, it doesn't compile.

    Any idea why that is?

    I have Qt Creator 2.3.1, Qt 4.7.4 (32 bit), MinGW 4.4

    Thanks!

    1 Reply Last reply
    0

    • Login

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Get Qt Extensions
    • Unsolved