3

I'm trying to use fat file for Boost 1.54.0 in my iOS project. Here is info about result file from lipo -detailed_info command:

Fat header in: boost.framework/boost
fat_magic 0xcafebabe
nfat_arch 5
architecture armv7
    cputype CPU_TYPE_ARM
    cpusubtype CPU_SUBTYPE_ARM_V7
    offset 108
    size 2963176
    align 2^2 (4)
architecture armv7s
    cputype CPU_TYPE_ARM
    cpusubtype CPU_SUBTYPE_ARM_V7S
    offset 2963284
    size 3079048
    align 2^2 (4)
architecture i386
    cputype CPU_TYPE_I386
    cpusubtype CPU_SUBTYPE_I386_ALL
    offset 8916872
    size 2830880
    align 2^2 (4)
architecture x86_64
    cputype CPU_TYPE_X86_64
    cpusubtype CPU_SUBTYPE_X86_64_ALL
    offset 11747752
    size 3015296
    align 2^2 (4)
architecture arm64
    cputype CPU_TYPE_ARM64
    cpusubtype CPU_SUBTYPE_ARM64_ALL
    offset 6042332
    size 2874540
    align 2^2 (4)

When I try to build for real device (iPad Mini Retina, arm64) I'm getting link error:

ld: archive has no table of contents file 'boost.framework/boost' for architecture arm64

I could build for armv7 simulator without errors. What could be a reason of the error?

John Tracid
  • 3,836
  • 3
  • 22
  • 33
  • If you're familiar with CMake you can check [this project](https://github.com/ruslo/hunter). I use it to build fat (armv7,armv7s,arm64,i386,x86_64) libraries like boost, openssl, gtest, ... –  Aug 23 '14 at 10:17

2 Answers2

5

I had the same problem and fixed it this way:

ranlib yourlibrary.a
Hyndrix
  • 4,282
  • 7
  • 41
  • 82
0

Update my own answer:

Hyndrix's answer saved my day!!!!!!

After read his answer, I tried use

ranlib src/boost-xcode5-iosx/ios//build/arm64/libboost.a

But it doesn't work.

So I tried rablib src/boost-xcode5-iosx/ios/framework/boost.framework/boost

I got some logs like: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib: for architecture: armv7 file: /Users/src/boost-xcode5-iosx/ios/framework/boost.framework/boost(libboost_serialization_stl_port.o) has no symbols /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib: for architecture: armv7s file: /Users/src/boost-xcode5-iosx/ios/framework/boost.framework/boost(libboost_serialization_stl_port.o) has no symbols /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib: for architecture: i386 file: /Users/src/boost-xcode5-iosx/ios/framework/boost.framework/boost(libboost_serialization_stl_port.o) has no symbols /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib: for architecture: x86_64 file: /Users/src/boost-xcode5-iosx/ios/framework/boost.framework/boost(libboost_serialization_stl_port.o) has no symbols

But then I rebuild the Xcode project it finally works for iOS Device now.

Thank you so much and I gave you an up vote.

John, you should mark his answer as the correct one.

I think it's because you are trying to build it for type "iOS Device" other than the real device.

It works fine if choosing the actual device or simulator.

But it is showing the exact same error msg if I choose "iOS Device".

Hope this will help you.

enter image description here

tly_alex
  • 103
  • 1
  • 9
  • Maybe I'm wrong but when I need to build version for distribution, I usually use _iOS Device_. Also could be a case when I don't have any device and need to create IPA. So I'm not sure it is a reason. – John Tracid Jul 08 '14 at 16:33
  • 1
    have you figured out why it's not working? When I use "lipo -info ~/src/boost-xcode5-iosx/ios/framework/boost.framework/boost" Architectures in the fat file: /Users/leyong/src/boost-xcode5-iosx/ios/framework/boost.framework/boost are: armv7 armv7s i386 x86_64 arm64 arm64 is showing up, but Xcode seems not pick it up. – tly_alex Jul 14 '14 at 04:51