Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » C / C++ IDE (CDT) » Pre-compiled Headers ?
Pre-compiled Headers ? [message #468068] Mon, 03 August 2009 21:25 Go to next message
Rob is currently offline RobFriend
Messages: 6
Registered: July 2009
Junior Member
Is there a way to setup and use precompiled headers in CDT using GCC?
If so, How would I do this?

Thanks,

Rob
Re: Pre-compiled Headers ? [message #468170 is a reply to message #468068] Tue, 04 August 2009 13:09 Go to previous messageGo to next message
Axel Mueller is currently offline Axel MuellerFriend
Messages: 1973
Registered: July 2009
Senior Member
Rob wrote:

> Is there a way to setup and use precompiled headers in CDT using GCC?
> If so, How would I do this?

> Thanks,

> Rob
You should read the GCC manual howto use precompiled headers. It has
nothing to do with the CDT.

Axel


http://gcc.gnu.org/onlinedocs/gcc-4.4.1/gcc/Precompiled-Head ers.html#Precompiled-Headers


Before you ask
- search this forum
- see the FAQ http://wiki.eclipse.org/CDT/User/FAQ
- google
Re: Pre-compiled Headers ? [message #468239 is a reply to message #468170] Tue, 04 August 2009 15:47 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: loaden.gmail.com

I hope too.
Re: Pre-compiled Headers ? [message #489546 is a reply to message #468068] Sun, 04 October 2009 18:35 Go to previous messageGo to next message
John  is currently offline John Friend
Messages: 1
Registered: October 2009
Junior Member
Hi,

I've been using the following workaround to get precompiled headers to work a bit more nicely with eclipse:

http://jdleesmiller.blogspot.com/2009/10/amazing-ruby-precom piled-header-hack.html

HTH.

John.
Re: Pre-compiled Headers ? [message #491062 is a reply to message #468068] Tue, 13 October 2009 05:21 Go to previous message
David Brady is currently offline David BradyFriend
Messages: 5
Registered: October 2009
Junior Member
It's a nice little hack, but it requires external software. You can do this entirely in Eclipse through a slightly uglier hack, I've discovered.

If you create a Resource Custom Build Step on your header file, you can specify the output name as "../stdafx.gch", and just copy/paste your compiler options into the command box.

Then you create a new make target (stdafx.gch), and add "make stdafx.gch" as a prebuild step.

The upside of this technique is that you can have multiple PCHs, (so you could have one per configuration), but the drawback is that it's still a hack, and you need to be careful to ensure that your PCH compiler options are the same as your compiler options for your other files.
Previous Topic:Extending CDT's GCC managed builder
Next Topic:Can't view Eclipse source after installing CDT6.0.1
Goto Forum:
  


Current Time: Fri Apr 26 08:59:01 GMT 2024

Powered by FUDForum. Page generated in 0.03175 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top