Author Topic: Precompiled headers with MinGW  (Read 8516 times)

Offline lesnewell

  • Multiple posting newcomer
  • *
  • Posts: 66
Precompiled headers with MinGW
« on: November 08, 2005, 06:34:33 pm »
Hi, how do you tell C::B to use precompiled headers with MinGW? It works fine in Linux but in the Windows version I can't find any way of setting it up. In the past I have manually compiled the header but it would be nice to get C::B to do it for me. In both cases I am using RC2 of course!

Offline Urxae

  • Regular
  • ***
  • Posts: 376
Re: Precompiled headers with MinGW
« Reply #1 on: November 08, 2005, 09:33:38 pm »
Right-click your file in the list to the left, Properties, check "Compile file", and be sure to put the "Priority weight" slider to something lower than that of any file that'll be using it so it'll be compiled before them.

Offline lesnewell

  • Multiple posting newcomer
  • *
  • Posts: 66
Re: Precompiled headers with MinGW
« Reply #2 on: November 08, 2005, 10:02:17 pm »
Yup, did that. It works in Linux but not Windows. I am using the same project file with different targets for each platform. In the project properties I get a bunch of precompiled header options in Linux but they aren't there in Windows. How do I tell C::B that the compiler can handle precompiled headers?

Offline mandrav

  • Project Leader
  • Administrator
  • Lives here!
  • *****
  • Posts: 4315
    • Code::Blocks IDE
Re: Precompiled headers with MinGW
« Reply #3 on: November 08, 2005, 11:29:10 pm »
Yup, did that. It works in Linux but not Windows. I am using the same project file with different targets for each platform. In the project properties I get a bunch of precompiled header options in Linux but they aren't there in Windows. How do I tell C::B that the compiler can handle precompiled headers?

The PCH options in project properties are in CVS, not in the released RC2.
Be patient!
This bug will be fixed soon...

Offline lesnewell

  • Multiple posting newcomer
  • *
  • Posts: 66
Re: Precompiled headers with MinGW
« Reply #4 on: November 08, 2005, 11:44:23 pm »
Ah, that makes sense. The Linux version was built from CVS.. I will have another go tomorrow and see if I can figure out why it doesn't work. Thanks.

Offline lesnewell

  • Multiple posting newcomer
  • *
  • Posts: 66
Re: Precompiled headers with MinGW
« Reply #5 on: November 11, 2005, 04:54:07 pm »
I found what the problem was. I had the Linux version generating the pch in it's own folder (precomp.h.gch). My Windows version is the official RC2 release so it does not have a setting to create a folder. It's internal dependency checking saw the folder and assumed it was actually an up to date header file so it refused to compile the header. Deleting the folder fixed the problem.