I'm using the "App Measurement for iPhone" libraries to build an iPad application. Previously I was using the iPhone 3.2 SDK and things worked great when building for both the simulator and the device.
The other day I upgraded to the 4.0 SDK to try out some new APIs. My existing iPad project still targets the 3.2 SDK, but the simulator builds no longer link due to this error:
Undefined symbols:
"_OBJC_CLASS_$_OMAppMeasurement", referenced from:
objc-class-ref-to-OMAppMeasurement in xyz.o
ld: symbol(s) not found
collect2: ld returned 1 exit status
The device builds still link and run fine. Since I'm still targeting the 3.2 SDK, I'm guessing this is more of an Xcode / gcc / etc. problem than an iPhone SDK problem, but that really is just a guess.
I used 'nm' on both versions of the Omniture libraries and noticed that symbol in the error message is present in the device version but not the simulator version:
000229f4 D _OBJC_CLASS_$_OMAppMeasurement
Anyone encountered similar problems? If any Omniture people read this: is there a chance of getting some dev's eyes on this to see if they can reproduce it?
Thanks for any help / suggestions / etc. in advance!
-Dave
So it appears that Omniture needs to re-build their libraries under the 4.0 SDK for the simulator to work. Any ideas on when that may happen?
Reply
Just wanted to keep this thread active - we're having the same issue and it's now holding a release up.
Sujal
Reply
Could anyone from Omniture give us at least an ETA of some sort? Can we hope to see a fix in the next day or two or are we weeks out?
This is holding up our QA process so we're trying to decide if we should just disable Omniture support for now or what. If a new release is imminent, we'll wait, but if it's going to be a while yet, then we'd like to know so that we can move forward.
A comment from an Omniture person would be greatly appreciated. Thanks!
Reply
We have a new tracking library for the iPhone 4.0 SDK for the Simulator. You can find it attached to this message. Our device tracking library that you've already been using prior to the 4.0 SDK still works, but this new one will work in the Simulator.
In the attached zip, there is a new libOmnitureAppMeasurement-iPhoneSimulator.a file. The other files, OMAppMeasurement.h and libOmnitureAppMeasurement-iPhoneDevice.a found in the original tracking library need not be changed. If you need these, please get them from the Code Gallery entry.
I am using the new 4.0 simulator library and the link errors are gone. That is good!
But I get this link warning:
ld: warning: in .../libOmnitureAppMeasurement-iPhoneDevice.a, file was built for unsupported file format which is not the architecture being linked (i386)
I am building for the simulator. I get the reverse (bad architecture for the device (arm) when I build for the device.
Is there a way to specify the right library for the right architecture in Xcode? Or did I add the libraries to the project incorrectly?
Thanks.
Reply
Good news, Xcode supports conditional linking based on SDK used (simulator/device). To set it up, from the Target's build options, invoke "Add Build Setting Condition" using the Action menu. Add one for the Simulator and another for the Device.
The attached file is a screen shot of the build settings section.
Reply