• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: The new prefix.h file.
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: The new prefix.h file.


  • Subject: Re: The new prefix.h file.
  • From: David Rio Vierra <email@hidden>
  • Date: Tue, 31 Dec 2002 08:02:25 -1000

It's a precompiled header. Put #include directives into it to include your favorite header files. PB will compile them all at once, so that they don't have to be recompiled for every source file that includes them. Each target can have a precompiled header, and it is implicitly included by every source file in that target. This greatly speeds compile times, especially if you're using an option like -fconstant-cfstrings which renders the existing Carbon precomps unusable.

If you're using C++ templates, such as the STL, you won't get much benefit unless you put template declarations like this one in your prefix header:

class vector<char *>;

This will tell the compiler that you're going to be using vector<char *> some time in the future, and it will whip up and precompile a vector class that deals with char *. You have to do this, because template classes aren't compiled unless they're actually used with template arguments, and are compiled separately for each distinct set of template arguments. Also, when using C++, I had to rename my prefix header to prefix_PROJECTNAME.cpp and adjust my target settings appropriately. I'm quite sure this all applies for Obj-C++ as well.

On Tuesday, December 31, 2002, at 07:40 AM, Colin Chicoine wrote:

When you create a new project, Project Builder creates this new _prefix.f file what is this for?
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.

References: 
 >The new prefix.h file. (From: Colin Chicoine <email@hidden>)

  • Prev by Date: Equivalent to "ps aux" in Cocoa?
  • Next by Date: Re: Novice Question....
  • Previous by thread: The new prefix.h file.
  • Next by thread: Novice Question....
  • Index(es):
    • Date
    • Thread