3

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?

user2109766
  • 115
  • 1
  • 7
  • I would also like to mention that I built it using Unity in Windows and then transferred the files to the Mac in my virtualbox. And I heard from somewhere that I need to build the project using Unity for Mac. But I hope that will solve the simulator sdk errors as well. – user2109766 Aug 05 '14 at 06:43
  • Yes compile under Mac. – Droppy Aug 05 '14 at 06:45

1 Answers1

1

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'

vishnuvarthan
  • 492
  • 1
  • 6
  • 23
  • Not really accurate; OSX/iOS use *fat binaries* which contain multiple architectures, so another reason for link failures is the fact that the library wasn't compiled for that architecture. There normally isn't a different library for Simulator and Device. – Droppy Aug 05 '14 at 06:45
  • what is not accurate if you find something need to be changed do edit my answer @Droppy – vishnuvarthan Aug 05 '14 at 06:52
  • 1
    I've explained what is not accurate and it's not my (nor anyone's as far as I know) custom to correct answers. – Droppy Aug 05 '14 at 06:54