XCode 6.4 Undefined symbols for architecture arm64

5.5k Views Asked by At

Build settings in my project:

Architectures: armv7,arm64

Build Active architectures only: NO

Valid Architectures: armv7 armv7s arm64 arm6

I downloaded a prebuilt version of the library from Marek Kotewicz's GitHub which supports 64-bit architecture which I verified by terminal as with the help of this link:

file libcryptopp.a

Output:

libcryptopp.a: Mach-O universal binary with 5 architectures
libcryptopp.a (for architecture i386):  current ar archive random library
libcryptopp.a (for architecture armv7): current ar archive random library
libcryptopp.a (for architecture armv7s):    current ar archive random library
libcryptopp.a (for architecture x86_64):    current ar archive random library
libcryptopp.a (for architecture arm64): current ar archive random library

I tried to clean and build the project and it resulted in errors in the project with a message

Undefined symbols for architecture arm64:

I have tried each and every answer present on the SO posts and now I am unable to solve this problem, I have to submit my app to App store ASAP.Can someone help me out?

P.S Setting Build active architectures to YES will not solve the problem.

2

There are 2 best solutions below

4
On

Change your Architecture's settings to this :

enter image description here

10
On

This is likely to be caused by wrong build script which created the libcryptopp.a without the correct architecture for some symbols/objects. You can use the following commands to verify this:

$ lipo -thin arm64 libcryptopp.a -output libcryptopp_arm64.a
$ mkdir objects
$ mv libcryptopp_arm64.a objects
$ cd objects
$ ar -x libcryptopp_arm64.a

Find CryptoPP.o in the extract object files, then, execute this in command line:

nm CryptoPP.o > CryptoPP_symbols.txt

In the output file, namely CryptoPP_symbols.txt, check if you can find symboles like:

Update
EnumToType

I suppose you won't find them, because that's what the problem is. If you have source code for libcryptopp.a, you should find what's wrong with the build script. If you don't have source code, what you can do is quite limited, i.e, ask the provider of the libcryptopp.a to correct this issue for you.