2
votes

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...

1

1 Answers

1
votes

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! enter image description here

Update: Fixed in Unity 4.3:

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