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

Re: Mixing Objective C and C++


  • Subject: Re: Mixing Objective C and C++
  • From: Ken Tozier <email@hidden>
  • Date: Fri, 30 Mar 2007 22:18:56 -0400

After spending the afternoon playing around with this, I found out the following:

- If the project is compiled with the Objective C compiler, Quark loads my XTension (as evidenced by NSLogs in some of the methods) but any calls to Quark library functions from inside a method crashes the app. This seems to make sense as the Quark headers are bristling with conditionals like the following

#if defined(__cplusplus) || defined(inline)
	/* inline functions here */
#else
	/* macros here */
#endif

- If the Objective C++ compiler is used, it compiles without error. When you go to run it, however, Quark has some sort of internal checker and pops up a dialog stating that the XTension isn't compatible with the current version.


Which leads to the following questions:

- What's the difference between code compiled in Objective C as opposed to Objective C++? I understand they are different languages but if anything, I would have thought that the Objective C compiled version would have less of a chance of loading than the Objective C+ +, as Quark XTensions require a C++ compiler. Strangely though it seems to be able to load Objective C XTensions (you just can't call any library functions)

- What is it about the Objective C++ compiler that renders an XTension unloadible while the Objective C compiled version can at least load?

- After reading Apple's info on Objective C++, I understand that there are some differences between it and straight C++, but since I have no access to the inner workings of the Quark library, what it's doing under the hood can only be guessed. What kinds of differences are there between Objective C++ and straight C++ that could prevent loading of a library?

Thanks for any insight/help

Ken


On Mar 30, 2007, at 2:23 PM, Ken Tozier wrote:

Hi

I'm working on a Quark XTension which requires that code be compiled with a C++ compiler. I've been hacking around in copies of the headers with the goal of getting the project to compile in Objective C. I finally got it working but when Quark loads the XTension it crashes. The crash log tries to run but hangs with an infinite spinning beach ball.

Next I tried compiling with the Objective C++ compiler and got the following error:

/usr/bin/ld: multiple definitions of symbol __Z8IsBitSetPPym.eh

I'm not really knowledgeable enough about the nitty gritty compiler details to know whether it's even possible to do what I'm trying to do. I have no control over the Quark stuff beyond the ability to group items within conditionals in the header. Is there some trick I can use so that the Objective C or Objective C++ compiler will create calls to Quark functions as if the C++ compiler was used?

Thanks for any help

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


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
  • Follow-Ups:
    • Re: Mixing Objective C and C++
      • From: "chinmoy Gavini" <email@hidden>
References: 
 >Mixing Objective C and C++ (From: Ken Tozier <email@hidden>)

  • Prev by Date: Re: multiple definitions of symbol _test ?
  • Next by Date: Interesting observation about build speed...
  • Previous by thread: Mixing Objective C and C++
  • Next by thread: Re: Mixing Objective C and C++
  • Index(es):
    • Date
    • Thread