Apple Mach O Linker Errors Trying to Build Unity App for iPhone Simulator

So I have this Unity app that I am trying to test in the iOS Simulator. I first chose the sdk simulator in Unity. I already have a version of an Android app released on the play store.

Anyway, I can't get it to build with 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 do I get the chartboost to run on a simulation architecture? or if not, how can I disable chartboost so that I can test my application without it? I have no iOS devices. So I can only test on a simulator.

I also tried to get a regular sdk build in Unity running in Xcode and I got various errors that I will have to deal with as well. I got 12 Apple Mach O Linkers errors:

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?

+3


source to share


1 answer


Common reasons for Undefined symbols for armv7 architecture are:

You are importing the header and not linking to the corresponding library. This is a common occurrence, especially with the headers of libraries such as QuartzCore, as it is not included in projects by default. To solve:

Add the correct libraries in the Link Binaries to 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 your build settings and add -l {library_name_without_lib_and_suffix} (for example, use -lz for libz.a) under Other Checkboxes linker "in build settings.

You are copying files into your project, but you forget to check the target to add files. To solve:

Open Build Phases for the correct target, expand Compile Sources and add the missing .m files.



You include a static library that is built for a different architecture like i386 simulator on your host machine. To solve:

If you have multiple library files from your library provider to include in your project, you need to include it for the simulator (i386) and for the device (like armv7).

Optionally, you can create a thick static library containing both architectures.

Also try

Remove only the built-in active architecture (build parameter setting key is "ONLY_ACTIVE_ARCH") from all build settings of your static libraries project or overwrite it with "NO"

+1


source







All Articles