Re: Why won't iOS app using MKMapView compile?
Re: Why won't iOS app using MKMapView compile?
- Subject: Re: Why won't iOS app using MKMapView compile?
- From: Kyle Sluder <email@hidden>
- Date: Fri, 08 Jul 2011 17:51:30 -0700
On Fri, Jul 8, 2011 at 5:45 PM, G S <email@hidden> wrote:
>> Are you compiling this file as Objective-C++?
>
> Yes, the implementation is an mm file.
>
Okay, that's important.
Look at $SDKROOT/usr/include/c++/4.2.1/cmath and you'll see that it
#undefines isinf and declares std::isinf as a wrapper. So if you
happen to #include <cmath> before #importing
<MapKit/MapKitGeometry.h>, the compiler will dutifully complain.
I don't know what the recommended solution would be here, since I
don't work with C++. Possible solutions that come to mind are
splitting your C++ code and Objective-C code into separate files, and
only including the bare minimum of glue in an Objective-C++ file; or
#importing <math.h> after whatever it is that #includes <cmath>, but
before #importing <MapKit/MapKit.h>; or inserting a `using namespace
std;` before #importing <MapKit/MapKit.h>.
But it's clear this is a result of using Objective-C++, not a fault in MapKit.
--Kyle Sluder
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden