John Tracid
John Tracid

Reputation: 4046

Fat library in Xcode 7

I'm having problem with building fat library for Boost with Xcode toolchain. Building itself works fine after some fixes in script but when I use it in project I'm getting linker error:

ld: in boost.framework/boost(atomic_lockpool.o), building for iOS simulator, but linking in object file built for OSX, for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

Also I found same problem at Apple Developer Forums but there is no any solution just people reporting same problem.

lipo -info output:

Architectures in the fat file: boost.framework/boost are: armv7 armv7s i386 x86_64 arm64

Upvotes: 1

Views: 771

Answers (1)

John Tracid
John Tracid

Reputation: 4046

Now it requires additional flag cxxflags="-miphoneos-version-min=7.0" for bjam.

Here is how bjam call looks like now (for simulator):

bjam -j$(CORES) --build-dir=$(IPHONESIM_BUILD_DIR) --stagedir=$(IPHONESIM_STAGE_DIR) --toolset=darwin-$(IPHONE_SDKVERSION)~iphonesim cxxflags="-miphoneos-version-min=7.0" architecture=x86 target-os=iphone macosx-version=iphonesim-$(IPHONE_SDKVERSION) link=static

Upvotes: 1

Related Questions