简体   繁体   中英

Xcode: Undefined symbols for architecture i386: DebugStringToFile when building Unity Project for iOS Simulator

I'm struggling with a Linker Error for an iOS project that was created with Unity 4.2.2. Since the last update of Unity, Xcode can't compile the project anymore, giving me the following error message:

Undefined symbols for architecture i386: "DebugStringToFile(char const*, int, char const*, int, int, int, int, int)", referenced from: prcore::Surface::ClearImage(prcore::color32 const&, prcore::Surface::ClearMode) in libiPhone-lib.a(blitter_integer.o) prcore::Surface::BlitImage(prcore::Surface const&, prcore::Surface::BlitMode) in libiPhone-lib.a(blitter_integer.o) ld: symbol(s) not found for architecture i386 clang: error: linker command failed with exit code 1 (use -v to see invocation)

Screenshot: Xcode中

Choosing the Device SDK and running it on the device works totally fine. But building for the iOS Simulator fails, no matter which settings I try to set in the project settings...

Unfortunately, this a bug in Unity 4.2.2, but will hopefully be fixed soon.

For the meanwhile, this simple workaround will do the job:

  1. open the class main.mm in Xcode
  2. satisfy the Linker by adding a definition for the missing function DebugStringToFile :

    void DebugStringToFile(char const*, int, char const*, int, int, int, int, int) { }

Finally, hit build and you're good to go! 在此处输入图片说明

Update: Fixed in Unity 4.3 :

  • iOS: Fixed iOS7 simulator support.
  • iOS: Fixed Xcode 5 build & run for simulator target

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM