Undefined symbols for architecture arm64 when archiving in Xcode

1,624 views
Skip to first unread message

Yong Duk Lee

unread,
Oct 13, 2013, 2:59:53 AM10/13/13
to cryptop...@googlegroups.com


Hello.


I am using the cryptopp library from cryptopp-5.6.2-ios-7.0 in Xcode 5.0.

Everything works fine, and I can run my program either in simulator or device.

However, when I try to archive the program in xcode to build ad-hoc app, it 

says "Undefined symbols for architecture arm64".


The library was said to be built for arm7, arm7s, arm64, i386. 


What could be wrong? Can anyone help? 


Thank you.





Jeffrey Walton

unread,
Oct 18, 2013, 7:15:21 PM10/18/13
to cryptop...@googlegroups.com


On Sunday, October 13, 2013 2:59:53 AM UTC-4, Yong Duk Lee wrote:


Hello.


I am using the cryptopp library from cryptopp-5.6.2-ios-7.0 in Xcode 5.0.

Everything works fine, and I can run my program either in simulator or device.

However, when I try to archive the program in xcode to build ad-hoc app, it 

says "Undefined symbols for architecture arm64".


The library was said to be built for arm7, arm7s, arm64, i386.

It is. You can use `lipo` to verify:
 
    $ xcrun -sdk iphoneos lipo -info libcryptopp.a
    Architectures in the fat file: libcryptopp.a are: armv7 armv7s arm64 i386

What could be wrong? Can anyone help?

I believe this as an Apple problem that is supposed to be fixed soon. The problem is `lipo` can build fat binaries that mix 32-bit and 64-bit code (e.g., libcrpytopp), but Xcode cannot at the moment (e.g., your app with 32-bit ARMv7, 32-bit ARMv7s and 64-bit ARM64). See "ARM64 and -mios-version-min=7.0?", http://lists.apple.com/archives/xcode-users/2013/Oct/msg00074.html.

Jeff

Wasin Thonkaew

unread,
Jul 16, 2014, 10:48:37 AM7/16/14
to cryptop...@googlegroups.com
Hi Yong,

I got stuck on these two linking errors. I post the whole message as follows.

Undefined symbols for architecture i386:
  "_clock$UNIX2003", referenced from:
      CryptoPP::X917RNG::X917RNG(CryptoPP::BlockTransformation*, unsigned char const*, unsigned char const*) in libcryptopp-osx.a(rng.o)
      CryptoPP::X917RNG::GenerateIntoBufferedTransformation(CryptoPP::BufferedTransformation&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, unsigned long long) in libcryptopp-osx.a(rng.o)
  "_sleep$UNIX2003", referenced from:
      CryptoPP::BlockingRng::GenerateBlock(unsigned char*, unsigned long) in libcryptopp-osx.a(osrng.o)
ld: symbol(s) not found for architecture i386
clang: error: linker command failed with exit code 1 (use -v to see invocation)

I've built cryptopp as a dynamic library (.a) separately for iOS device, and simulator.
I can successfully build the project with cryptopp and run on iOS device, but not for simulator in which it shows the error above.

Do I miss anything?

Wasin

Wasin Thonkaew

unread,
Jul 16, 2014, 4:52:21 PM7/16/14
to cryptop...@googlegroups.com
Hi Yong,

After spent a night with it, I finally use the pre-build available at https://github.com/noloader/cryptopp-5.6.2-ios.
It contains fat binary for arm7 arm7s arm64 and i386. This ways solves me a problem that I once have to separate building a project into 2 targets (device, and simulator).

Thanks

Wasin


--
--
You received this message because you are subscribed to the "Crypto++ Users" Google Group.
To unsubscribe, send an email to cryptopp-user...@googlegroups.com.
More information about Crypto++ and this group is available at http://www.cryptopp.com.
---
You received this message because you are subscribed to a topic in the Google Groups "Crypto++ Users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/cryptopp-users/Y-Rnmuo-Fts/unsubscribe.
To unsubscribe from this group and all its topics, send an email to cryptopp-user...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
Twitter: @haxpor
Skypehaxpor
Reply all
Reply to author
Forward
0 new messages