• 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: problems with Objective-C++
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: problems with Objective-C++


  • Subject: Re: problems with Objective-C++
  • From: "Daniel E. White" <email@hidden>
  • Date: Tue, 22 Jan 2002 09:07:53 -0500

OK, I think I found it:

file://localhost/Developer/Documentation/ReleaseNotes/Objective-C++.html#debugging

It should be in your local development documentation

It says:
Using Precompiled Headers with Objective-C++
Due to syntactic limitations of the cpp-precomp tool, precompiled headers are disabled by default when compiling C++ and Objective-C++. (By contrast, precompiled headers are enabled by default for C and Objective-C.) Nevertheless, it is possible to make use precompiled headers in Objective-C++ (and C++) so long as they contain only C and Objective-C code -- and this includes the Cocoa, AppKit, Foundation and Carbon headers residing on the system.

In order to enable the use of precompiled headers in Objective-C++ and C++, simply supply the -cpp-precomp command-line flag to the compiler. (Conversely, you
may pass in -no-cpp-precomp to suppress their usage in any language.) To rebuild the precompiled headers installed on the system, you may issue the command

$ fixPrecomps -force

from a Terminal window.

I tried it and found one missing detail: Because you are messing with the installed compiler, you need to do it like this:

$ sudo fixPrecomps -force

Hope it helps.

At 9:39 PM -0500 1/21/02, Andrew Pinski wrote:
>The reason why it takes longer is because Apple forgot to turn on pre-compiled headers on (this was answered before look into the archives.).
>
>
>Thanks
>Andrew Pinski
>On Monday, January 21, 2002, at 03:47 , Simson L.Garfinkel wrote:
>
>> It has been commented on this mailing list that Objective-C++ takes 20x longer to compile a file than Objective-C or C++, but nobody has ever said why or what to do about it.
>>
>> I am working on a large project that involves Objective-C and C++. I had wanted to use Objective-C++. Changing the extension of an Objective-C file from .m to .mm I saw the size of each .o file balloon from approximately 200k to 6M! I saw compile times go from 2-3 seconds to 30-60 seconds!
>>
>> This was unacceptable.
>>
>> So what I have done is I have tried to segregate the cross between the Objective-C world and the C++ world to as few areas as possible. right now it is in 2 classes. These are the only two that are .mm files; the rest are .m files. These are the two classes that have C++ objects in their instance variables. There is no problem messaging these classes from .m files, so it's a huge win, really. If other methods need to call C++ classes but not have C++ objects as instance variables, I put all of those methods into a separate .mm file that is done as a category.
>>
>> All of this works, but it is kind of difficult.
>_______________________________________________
>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.

--
------------------------------------------------------------------------
Dan White
------------------------------------------------------------------------
"Sometimes I think the surest sign that intelligent life exists
elsewhere in the universe is that none of it has tried to contact us."
Calvin (Bill Watterson)


References: 
 >Re: problems with Objective-C++ (From: Andrew Pinski <email@hidden>)

  • Prev by Date: Re: Apple Serial Number: Redux
  • Next by Date: Feature request (was: SIGBUS and NSLog)
  • Previous by thread: Re: problems with Objective-C++
  • Next by thread: Re: problems with Objective-C++
  • Index(es):
    • Date
    • Thread