- Home /
Undefined symbols for architecture i386: with 200+ apple mach-o linker (Id) errors
I have just purchased Unity iOS 3.4.2f2 and am running it on an Apple Macbook running 10.6.8 Snow Leopard. I am using XCode 4.2 on the same computer.
I have tried several simple example Unity projects and have run the default build for iOS and when I try to build them in XCode for the iPhone 5.0 Simulator, I get the following 201 apple mach-o linker (Id) errors:
ld: warning: ignoring file /Users/Shared/Unity/TestProj/iOSbuild/Libraries/libiPhone-lib.a, missing required architecture i386 in file
Undefined symbols for architecture i386:
"UnityUse32bitDisplayBuffer()", referenced from: CreateWindowSurface(EAGLView*, unsigned int, unsigned int, unsigned int, bool, EAGLSurfaceDesc*) in AppController.o OpenEAGL_UnityCallback(UIWindow*, int, int*, int*) in AppController.o
"UnityGetTargetResolution()", referenced from: CreateSurface(EAGLView*, EAGLSurfaceDesc*) in AppController.o
"UnitySetInputScaleFactor(float)", referenced from: CreateSurface(EAGLView*, EAGLSurfaceDesc*) in AppController.o
...201 apple mach-o linker (Id) errors.
I get the same build errors with all Unity iOS projects I have tried.
Over the past couple of weeks, I have attempted all of the fixes suggested in the unityAnswers forum and have had no success whatsoever.
As a new user, I am probably missing something obvious for you experienced guys. It is stopping me dead in the water from progressing onto any useful app development.
Please point me in the right direction, so that I can move forward with my work.
Following further reading in the forums, it has become apparent to me that the default build of and iOS project from Unity is missing one or more classes - hence the referenced methods. From the names of all these methods, they appear to all be standard Unity functionality and presumably are contained in a Unity framework. I can find no mention of such a base Unity framework and would expect that such a framework would automatically be added to a default iOS build from a simple model (a box!). Building such a Unity iOS build in XCode consistently fails for me with the same 200+ method reference errors.
Can anyone please tell me what I am missing in the Unity iOS builds that is causing this catastrophic failure?
Answer by Hermes · Jan 30, 2012 at 12:50 PM
I figured it out!
Being new to Unity iOS and XCode, I didn't realise you need to set the Unity Player Settings SDK Version to iOS Simulator to have XCode build and run in the iPhone simulator. Hence the "Undefined symbols for architecture i386:" errors. Makes sense now.
Runs in the simulator and on the physical iPhone now.
Very disappointed that over 200 viewers of this question and nobody even made a suggestion to point me in the right direction on such a novice error.
I know this is old, but thought I would share my experience. Running XCode 6.1 and Unity 4.6. I found that you must build (in Unity) for simulator SD$$anonymous$$ to run it on the simulator, and you must build (in Unity) for device SD$$anonymous$$ to run it on your device. Perhaps this is obvious? But co$$anonymous$$g from iOS development, it is strange that unity must be built specifically for each environment. I tried switching directly from simulator to device in XCode, and it failed with errors like the above.
Answer by gegagome · Dec 05, 2012 at 12:49 AM
How did you archive to iOS device? I am stuck in this part.
Answer by Hermes · Dec 05, 2012 at 02:39 AM
Set the Unity build settings to iOS device and run the build. Then in Xcode, plug your iOS device into your computer and select the device name at the top of the screen and press the run arrow button to build and run the app on your physical iOS device.
Hope this answers your question.
Your answer
![](https://koobas.hobune.stream/wayback/20220613062650im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
What might make an iOS game crash out without any Xcode error messages? 3 Answers
XCode Errors: "_AVCaptureSession" - Unity 3.5 compile problems? 2 Answers
Xcode error when Archiving linker command failed with exit code 1 (use -v to see invocation) clang 1 Answer
Working .pod with admob and googleplayservice for ios 0 Answers
Unity + XCode Problem (really wierd) 0 Answers