• 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: bringing windows c++ code to Macintosh
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: bringing windows c++ code to Macintosh


  • Subject: Re: bringing windows c++ code to Macintosh
  • From: Ken Thomases <email@hidden>
  • Date: Wed, 10 Sep 2008 04:34:10 -0500

As others have pointed out, a big part of your problem is that you're trying to compile plain C (or Objective-C) files that contain C++ code. You need to put C++ code into .cpp or .mm files. (It is possible to tell Xcode to treat a file as C++ or Objective-C++ regardless of its extension, but you'll just confuse yourself if you go that route.)

Beyond that...

On Sep 10, 2008, at 1:33 AM, M Pulis wrote:

(1) How should fields declared as HGLOBAL be declared as on Macintosh? I have tried "handle" but Xcode complains (why???). Tried uint32, which allowed compilation to continue, BUT, it feels wrong.

The short answer is that you don't declare those fields as anything on the Mac. If you don't understand that porting to the Mac means totally revamping or replacing any code which currently uses Win32- specific data types, then you're not going to get very far.


You need to examine what those HGLOBAL fields are being used for (their semantics, not their syntax), research what the appropriate alternative would be to achieve similar semantics in the Mac API(s) that you've chosen, and then rework the code in terms of those new Mac APIs. It is never going to be as simple as just declaring the same fields with different type. You may not need those fields, you may need different fields, you may need more fields or fewer -- it requires redesign.

Regards,
Ken

_______________________________________________
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: bringing windows c++ code to Macintosh
      • From: M Pulis <email@hidden>
References: 
 >bringing windows c++ code to Macintosh (From: M Pulis <email@hidden>)

  • Prev by Date: adding object to a Xcode project
  • Next by Date: Re: bringing windows c++ code to Macintosh
  • Previous by thread: Re: bringing windows c++ code to Macintosh
  • Next by thread: Re: bringing windows c++ code to Macintosh
  • Index(es):
    • Date
    • Thread