JOM
JOM

Reputation: 8207

Framework not found MapKit

I am using Xcode 3.2.1 in project, where Base SDK is iPhone Device 3.0 and iPhone OS Deployment Target is iPhone OS 2.0, in other words a backwards compatible application.

The problem is MapKit Framework. It's added as Weak linked library, but the app just does not link for "Device - 2.2.1" target. I have run out of ideas... What else can I do but mark the library as "weak" linked? It used to work originally, but not any more.

Here's part of command line, which looks just fine to me:

-framework Foundation -framework UIKit -framework CoreGraphics
 -weak_framework CoreLocation -weak_framework MapKit

Error note:

ld: framework not found MapKit
collect2: ld returned 1 exit status
Command /Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/g++-4.0 failed with exit code 1

Upvotes: 1

Views: 1646

Answers (3)

JOM
JOM

Reputation: 8207

Just to clarify the problem and solution:

Problem: I wanted to create a backwards compatible application, which would run on both iPhone OS 2.x and 3.x devices. It would use 3.x specific features when available e.g. MapKit.

Solution: set your "Base SDK as iPhone Device 3.0" and "iPhone OS Deployment Target as iPhone OS 2.0". Connect your iPhone OS 2.x device (mine was iPod Touch, where I refuse to upgrade to latest available iPod software version) and select at top left corner the target as "Device - 3.0" - even when your connected device is NOT 3.0 compatible at all !!!

Pretty confusing, looks totally non-logical at first, but that's the way it works!

Upvotes: 1

cdespinosa
cdespinosa

Reputation: 20799

Try the MailComposer sample project from Apple, which does a similar thing with the MessageUI framework. What you may need to do is set the Base SDK to 2.2.1 instead of 2.0.

Upvotes: 1

David Maymudes
David Maymudes

Reputation: 5654

To run your app on 2.2.1, you don't need to choose 2.2.1 in that menu, just leave the "Active SDK" set to 3.0 or beyond.

Upvotes: 1

Related Questions