Reputation: 115
So I have this Unity App that I'm trying to test in the iOS Simulator. I selected the simulator sdk in Unity before building. I already have the android version of the app released in the play store.
Anyway, I can't get it to build in Xcode. I keep getting these 3 build errors:
ld: warning: ignoring file /Users/myaccount/Desktop/untitled
folder/Libraries/libChartboost.a, missing required architecture i386 in file
/Users/danmelamed/Desktop/untitled folder/Libraries/libChartboost.a (2 slices)
ld: warning: ignoring file /Users/myaccount/Desktop/untitled
folder/Libraries/libSoomlaIOSStore.a, missing required architecture i386 in file
/Users/myaccount/Desktop/untitled folder/Libraries/libSoomlaIOSStore.a (2 slices)
Undefined symbols for architecture i386:
"_OBJC_CLASS_$_CBAnalytics", referenced from:
objc-class-ref in ChartBoostBinding.o
"_OBJC_CLASS_$_Chartboost", referenced from:
objc-class-ref in ChartBoostBinding.o
objc-class-ref in ChartBoostManager.o
ld: symbol(s) not found for architecture i386
clang: error: linker command failed with exit code 1 (use -v to see invocation)
"_OBJC_CLASS_$_CBAnalytics", referenced from:
objc-class-ref in ChartBoostBinding.o
"_OBJC_CLASS_$_Chartboost", referenced from:
objc-class-ref in ChartBoostBinding.o
objc-class-ref in ChartBoostManager.o
ld: symbol(s) not found for architecture i386
How would I get chartboost to run in the simulator architecture? or if not, how can I disable chartboost so that I could test my app without it? I don't own any iOS devices. So I can only test on simulator.
I also tried to get the regular sdk build in Unity running in Xcode and I got different errors that I would need to deal with as well. I got 12 errors of Apple Mach O Linkers:
Undefined symbols for architecture armv7:
"_iosLogin", referenced from:
RegisterMonoModules() in RegisterMonoModules.o
"_iosLogout", referenced from:
RegisterMonoModules() in RegisterMonoModules.o
"_iosInit", referenced from:
RegisterMonoModules() in RegisterMonoModules.o
"_iosSetShareDialogMode", referenced from:
RegisterMonoModules() in RegisterMonoModules.o
"_iosFeedRequest", referenced from:
RegisterMonoModules() in RegisterMonoModules.o
"_iosAppRequest", referenced from:
RegisterMonoModules() in RegisterMonoModules.o
"_iosFBSettingsPublishInstall", referenced from:
RegisterMonoModules() in RegisterMonoModules.o
"_iosFBAppEventsSetLimitEventUsage", referenced from:
RegisterMonoModules() in RegisterMonoModules.o
"_iosGetDeepLink", referenced from:
RegisterMonoModules() in RegisterMonoModules.o
"_iosFBAppEventsLogPurchase", referenced from:
RegisterMonoModules() in RegisterMonoModules.o
"_iosFBAppEventsLogEvent", referenced from:
RegisterMonoModules() in RegisterMonoModules.o
ld: symbol(s) not found for architecture armv7
clang: error: linker command failed with exit code 1 (use -v to see invocation)
What could it be?
Upvotes: 3
Views: 2870
Reputation: 512
The common causes for "Undefined symbols for architecture armv7" are:
You import a header and do not link against the correct library. This is common, especially for headers for libraries like QuartzCore since it is not included in projects by default. To resolve:
Add the correct libraries in the Link Binary With Libraries section of the Build Phases.
If you want to add a library outside of the default search path you can include the path in the Library Search Paths value in the Build Settings and add -l{library_name_without_lib_and_suffix} (eg. for libz.a use -lz) to the Other Linker Flags section of Build Settings.
You copy files into your project but forgot to check the target to add the files to. To resolve:
Open the Build Phases for the correct target, expand Compile Sources and add the missing .m files.
You include a static library that is built for another architecture like i386, the simulator on your host machine. To resolve:
If you have multiple library files from your libraries vendor to include in the project you need to include the one for the simulator (i386) and the one for the device (armv7 for example).
Optionally, you could create a fat static library that contains both architectures.
Also try this
Remove Build Active Architecture Only (build setting parameter key is 'ONLY_ACTIVE_ARCH') from all of your static libraries' project build settings or overwrite it with 'NO'
Upvotes: 1