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
Here is how I got everything to compile correctly with no errors or warnings. Hopefully this is helpful.
Reply
- I am using the libOmnitureAppMeasurement-iPhoneSimulator.a that brent posted above in a zip file plus the original libOmnitureAppMeasurement-iPhoneDevice.a library
- I am using Xcode version 3.2.3:
-
Conditionally linking the libraries for device and simulator as described:
- Added the Omniture libraries to my project as normal files so that they would go into source control
- In Groups & Files I removed the Omniture libraries from Targets->{TargetName}->Link Binary With Libraries
- Under "Project" menu then "Edit Project Settings" in the buid tab for configuration "All Configurations" highlight "Other Linker Flags" (also known as "OTHER_LDFLAGS")
- In the bottom left corner click on the gear drop down then "Add Build Setting Condition"
- For the new setting condition I selected "Any iPhone OS Device" for the SDK and "Any Architecture" for the architecture.
- Then for the actual flag I entered a relative path "Classes/Omniture/libOmnitureAppMeasurement-iPhoneDevice.a" (change the path for your actual path where the library is located)
- repeat steps 3-6 for the simulator sdk and library
I attempted to dynamically link as shown here, and it worked with the simulator, but still gives a compile error when compiling for the device. I get the following error:
"___switch8", referenced from:
-[OMAppMeasurementModuleMedia playerEvent:eventType:offset:offsetName:] in libOmnitureAppMeasurement-iPhoneDevice.a(OMAppMeasurementModuleMedia.o)
Reply
I am getting the same error as bfanball, even after adding the project settings indicated. I am using Xcode 3.2.4 and trying to test on a device using iOS 4.1. Anyone have any experience with this?
Reply
I originally downloaded the Omniture iOS library here: https://developer.omniture.com/node/1809 However, I don't think this is the latest version.
My client sent me a new version of the library including the simulator (libOmnitureAppMeasurement-iPhoneSimulator.a), device (libOmnitureAppMeasurement-iPhoneDevice.a), and header (OMAppMeasurement) files which he downloaded using the "code generator" which I assume is accessed once he logged into his Omniture account. The files sizes are different and I see a number of changes to the header file (one change is that the prop values now go up to prop75 - an older version only went up to prop50).
In addition to the steps I mentioned in my previous post, I did this:
Under "Project" menu then "Edit Project Settings" in the buid tab for configuration "All Configurations" add to "Library Search Paths" (aka LIBRARY_SEARCH_PATHS) a relative path to where the Omniture files are located. Mine looks like this: "$(SRCROOT)/Classes/Utilities/Omniture"
Using my previous steps and the new step I described here and with the latest version of the Omniture library I got from my client, I am getting no build errors or warnings for the simulator or device. Here is some other info about my project:
- Xcode 3.2.5
- Base SDK (SDKROOT) 4.2 (though technically I have it set to "Latest iOS" which setting definition "iphoneos")
- iOS Deployment Target (IPHONE_OS_DEPLOYMENT_TARGET) of 3.0
- Target Device Family (TARGETED_DEVICE_FAMILY) "iPhone/iPad" (which is setting definition "1,2")
Reply
We have solved the Simulator Problem with this new Library you have posted but we still recive the error message when we try to compile the Device Library.
Can you please post a Device Library recompiled for the SDK 4.0?
Reply
You should be able to get the tagging code for this in the Admin Console. Please let us know if you can't find it.
Thanks!
-Brent
Reply