views:

2863

answers:

2

I'm having a problem getting Pinch Analytics r64, a static library built with iPhone SDK 3.0, to link properly in my application which is targetting iPhone OS 2.0. This seems to be a fairly common problem, and Pinch Analytics' site even has an entire page devoted to answering this question.

Basically, they say to set your project's Base SDK to 3.0 and set your iPhone OS Deployment Target to SDK 2.0 (or whatever version you're targetting). I have taken both of these steps, verified that I'm not overriding any of the project settings in my target settings, have cleaned my targets, but still I'm getting the following linker errors:

Undefined symbols:
"___restore_vfp_d8_d15_regs", referenced from: -[Beacon connectionDidFinishLoading:] in libPMAnalytics-r64.a(Beacon.o) -[Beacon connection:didFailWithError:] in libPMAnalytics-r64.a(Beacon.o)

"___save_vfp_d8_d15_regs", referenced from: -[Beacon connectionDidFinishLoading:] in libPMAnalytics-r64.a(Beacon.o) -[Beacon connection:didFailWithError:] in libPMAnalytics-r64.a(Beacon.o) -[Beacon connection:didReceiveData:] in libPMAnalytics-r64.a(Beacon.o)`

etc.

I'm coming to my wit's end here; any suggestions would be great!

+4  A: 

Check your compiler. I suspect you have a mismatch between code compiled with LLVM-GCC4.2 and GCC4.0.

Rob Napier
You're right - looking back through my compile output I am using gcc-4.0. I'm not sure where to change this though, as my project and target settings both specify the default, 4.2.
pix0r
Are you compiling for the Simulator or Device? I didn't think you could compile iPhoneOS on 4.2 quite yet, though from your errors it suggests that libPMAnalytics-r64.a was compiled with LLVM. Start by setting your compiler to 4.0 and see if that addresses the issue.
Rob Napier
Just answered my own question - but I appreciate your help. I was using the dropdown on the Project window to select what I thought was the Target SDK. This is not correct, always leave this set to the same version as Base SDK in Project Info.Thanks!
pix0r
+3  A: 

After a few emails with the Pinch Media team, the problem is solved. Basically, you should NEVER USE THE DROPDOWN TO SELECT A DIFFERENT ACTIVE SDK.

Set Base SDK to 3.0 in Project Info. Set iPhone OS Deployment Target to 2.0 (or whichever version you're targetting) in Project Info. Leave the device/configuration/target dropdown set to the Base SDK (3.0), or Xcode will use the OLD toolchain associated with the selected "Active SDK".

pix0r