• 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: Framework issues
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Framework issues


  • Subject: Re: Framework issues
  • From: Work <email@hidden>
  • Date: Wed, 23 Mar 2005 09:20:23 -0600

Hello,

I have found that including third party C++ headers into a .mm file can be problematic. Essentially the third party does not adhere to the restrictions set by compiling c++ under obj-c (like using the id keyword).

As a general rule I isolate the third party dependencies into the private implementation (cpp files only) of my own C++ classes. That way I have control over the indirect dependencies of between the third party code and any other area of the software.

Dave

On Mar 22, 2005, at 6:33 PM, Phil Ershler wrote:

Oh good gosh you're right. The interesting thing is the project that worked had the file with a .M extension. When I changed my file to .M it still didn't work, but when I changed it to .mm, things compile fine. By the way the main.m file was from a quick test. Is there some preference somewhere in X-Code that defaults the compiler to be used. I would think that if I started a new Cocoa application (from X-Code's templates) and then asked Interface Builder to create my initial files, they would default to Objective-C. I guess not. I got the same (undesireable) results from having files created from Interface Builder (the resulting files have a .m extension).

Thanks for your time,

Phil Ershler

P.S. I'm honored to have my stupid question answered by someone of your stature! Your signature must be inside my Mac Plus somewhere.


On Mar 22, 2005, at 4:38 PM, Chris Espinosa wrote:

On Mar 22, 2005, at 3:27 PM, Philip Ershler wrote:


OK, consider my "hand slapped". I have moved the framework into /Library/Frameworks. This has not changed the behavior (didn't really expect it to). Also, for some additional info I am running X-Code 1.5 on 10.3.8. Here is some more information of the errors that I get when I

<snip>

You're trying to compile C++ code as Objective-C.  The "namespace" directive does not exist in Objective-C.

Best to change your main to a ".mm" file.

Chris
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden _______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden
 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

References: 
 >Framework issues (From: Phil Ershler <email@hidden>)
 >Re: Framework issues (From: Scott Tooker <email@hidden>)
 >Re: Framework issues (From: Philip Ershler <email@hidden>)
 >Re: Framework issues (From: Chris Espinosa <email@hidden>)
 >Re: Framework issues (From: Phil Ershler <email@hidden>)

  • Prev by Date: Re: worth it to target 10.1?
  • Next by Date: Framework dependent on itself?
  • Previous by thread: Re: Framework issues
  • Next by thread: Re: Framework issues
  • Index(es):
    • Date
    • Thread