Code::Blocks Forums

User forums => Using Code::Blocks => Topic started by: lesnewell on November 08, 2005, 06:34:33 pm

Title: Precompiled headers with MinGW
Post by: lesnewell 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!
Title: Re: Precompiled headers with MinGW
Post by: Urxae 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.
Title: Re: Precompiled headers with MinGW
Post by: lesnewell 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?
Title: Re: Precompiled headers with MinGW
Post by: mandrav 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.
Title: Re: Precompiled headers with MinGW
Post by: lesnewell 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.
Title: Re: Precompiled headers with MinGW
Post by: lesnewell 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.