Linker errors with libiPhone-lib.a

Hello! I inherited a project and am trying to get it to build. I’m very very new to unity and am not sure what all the libs are supposed to do. In any case I’m getting a linker error when trying to build the project from xcode

“Alg::compression::Lzma::decode(Alg::compression::Lzma::CompressPrefix, void*, unsigned long, unsigned char const*, char const*, unsigned long)”, referenced from:
Pfx::Asm::Lzma::uncompress(unsigned char*, unsigned long, unsigned char const*, unsigned long) in libiPhone-lib.a(asmlzma.o)
ld: symbol(s) not found for architecture i386

I’m not sure what I’m doing wrong here. Anyone have any insight?

OH: I’m using xcode v5.0 and unity v4.2.f14.

Thank you!

I’m getting this error too…when I try to build for Simulator. When I build for an iOS device, it doesn’t happen. XCode 5 makes it less obvious that you have the simulator target selected, since it no longer says the word “simulator” in the selection choice. Anyway, double-check that.

Incidentally, I’d really like to be able to build with the Simulator, so if anyone knows how to address this problem, I’d be very interested.

This is sort of a bump. I have updated Unity to version 4.2.2f. I am still having the same problem. I also upgraded my OSX version to Maveriks and I have another linker error (this is the entire 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)
prcore::MemoryStream::Seek(int, prcore::Stream::SeekMode) in libiPhone-lib.a(memorystream.o)
“Alg::compression::Lzma::decode(Alg::compression::Lzma::CompressPrefix, void*, unsigned long, unsigned char const*, char const*, unsigned long)”, referenced from:
Pfx::Asm::Lzma::uncompress(unsigned char*, unsigned long, unsigned char const*, unsigned long) in libiPhone-lib.a(asmlzma.o)

ANY help would be appreciated. Thank you!

Are you guys sure that you have selected “SDK Version: Simulator SDK” in Player Settings?

Has anyone figured this bug out? I’m stuck with the exact same error and it’s the only thing stopping me from getting my app working on a simulator and extremely frustrating. I’m using Unity 4.2.2f1 and Xcode 5.0.1. I did select simulator in the player settings in Unity.

This is my full error:
Undefined symbols for architecture i386:
“Alg::compression::Lzma::decode(Alg::compression::Lzma::CompressPrefix, void*, unsigned long, unsigned char const*, char const*, unsigned long)”, referenced from:
Pfx::Asm::Lzma::uncompress(unsigned char*, unsigned long, unsigned char const*, unsigned long) in libiPhone-lib.a(asmlzma.o)
ld: symbol(s) not found for architecture i386

Any help would be awesome.

I have not figured it out. @proandrius, yes, simulator is selected. But note in Xcode 5 it labels it differently in the dropdown. “iPhone Simulator” is in very light grey as a header, and then the actual selection is something like “iPhone Retina (3.5-inch)”.

I can’t find a single topic on this issue and have no idea what it’s telling me. Because the build is coming directly from Unity, I can’t really debug the problem. =(

I managed to fix my issues. Basically, I was using Prime31 plugins for Unity. Apparently, they weren’t getting synced up right or something to the Xcode project so I removed all the files and scenes associated with those plugins( Twitter, Facebook, Admob ). Once I removed those files, I was able to run the emulator.

However, when I ran the emulator, all I got was a black screen. I went to Product > Scheme > Edit Scheme and in the run tab, changed debugger to none. And then when the emulator was running, I went to Emulator > Reset Content and Settings. It took a minute or two to do that the first time, but my game now runs on the emulator.

However, I can’t seem to get rid of the “Development Build” in the bottom right of the screen. In unity, I have the development build box unchecked so there’s no reason it should be there. The whole point of getting it to run on the emulator was to simply take screenshots. I’ll tell you, Apple just can’t make this an easy process can they? Argg.

You can take screenshots from Editor. And you can even modify them in Photoshop, there isn’t any rule forbidding that.

Agent_007, that’s good to know. I was under the impression that Apple required unmodified images for some reason. I’m still happy I got it working though, so I could at least make sure the game looks good on the different phones and tablets.

Just in case someone else runs into the same issue, I managed to fix it by removing the “-all_unload” flag from Other Linker Flags in Xcode.

1 Like

I have not tried the fix Afroman suggests ( @Afroman : do you mean “-all_load” by any chance?) but managed to fix the issue with following procedure:

  • prerequisites:

  • make sure you’re building for the simulator SDK (latest version) in Unity

  • make sure you have set up the latest iOS version (7.1) in xcode as base SDK

  • open the terminal program (mac shell/bash)

  • navigate to your projects library folder (cd command)

  • make sure you’re in the right directory by typing ls -a libiphone-lib.a (a file should be found)

  • we’re going to change the above archive

  • since this is a fat file for more than one architecture use the command

  • lipo libiPhone-lib.a -thin i386 -output libiPhone-lib_i386.a to extract the relevant architecture i386

  • now delete the object file causing the problem with the command
    ar -d libiPhone-lib_i386.a asmlzma.o

  • delete libiphone-lib.a

  • rm libiPhone-lib.a

  • and rename/move the modified libiphone-lib_i386.a to replace the deleted libiphone-lib.a

  • mv libiPhone-lib_i386.a ./libiPhone-lib.a

  • xcode:

  • clean up project

  • build the project normally

@JunaOne Yes I do! Try it out and see if it works

I used prime31,I found it’s because of Prime31MenuItem.dll can’t run in simulator.Just delete it.
I can delete this dll, because I just use it’s twitter plugin,no configure needed.

I used prime31,I found it’s because of Prime31MenuItem.dll can’t run in simulator.Just delete it.
I can delete this dll, because I just use it’s twitter plugin,no configure needed.

Removed “all_load” from the linker flags. It worked!

1 Like