login about faq

Hi ,

I am using the chilkat libs as instructed at http://www.chilkatsoft.com/downloads_ios.asp and I am encountering the follwoing error like other persons as well. I am developing for iOS only , but receive the following error:

ld: in /Users/.../lib/libchilkatIos.a(CkoCrypt2.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)

I am using the following script at the BUILD PHASES / RUN SCRIPT section at Xcode 7 to create one universal lib ( that worked fine at xcode 6.4 ) :

cd lib /usr/bin/libtool -static i386/libchilkatIos.a x86_64/libchilkatIos.a armv7s/libchilkatIos.a armv7/libchilkatIos.a arm64/libchilkatIos.a -o libchilkatIos.a cd ..

Can somone help, please ? It´s really urgent !

best regards


asked Sep 17 '15 at 07:32

JHE's gravatar image


Note: The iOS 9 version should be for iOS 6.0 and above. The important thing is that bitcode is enabled on this build, and that it's built using Xcode 7.


answered Sep 21 '15 at 12:12

chilkat's gravatar image

chilkat ♦♦

Thanks Jan,

You provided this additional information in private email, and I think this is the solution:

In Xcode 7, the linker enforces that all files linked together were built for the same platform. You control the platform via -mmacosx-version-min=XX or -miphoneos-version-min=XX compiler options.

You can see which platform an object file was built for by running “otool -lv” on the .a (or .o) file. and look for LC_VERSION. You should see LC_VERSION_MIN_IPHONEOS, LC_VERSION_MIN_MACOSX, LC_VERSION_MIN_WATCHOS, or LC_VERSION_MIN_TVOS.

Besides now longer being able to mix OSX intel binaries and simulator binaries, this means going forward, you need to build different libraries for the iOS, watchOS, and tvOS simulators.

I think the individual libs are fine. For example, i386/libchilkatIos.a is correctly compiled with LC_VERSION_MIN_MACOSX and armv7s/libchilkatIos.a is correctly compiled with LC_VERSION_MIN_IPHONEOS. I think the solution is to produce two separate "universal" libs:

  • Create one universal lib for the simulator, and this includes i386/libchilkatIos.a and x86_64/libchilkatIos.a
  • Create one universal lib for the device, and this would include armv7s/libchilkatIos.a, armv7/libchilkatIos.a, and arm64/libchilkatIos.a

You would run two libtool commands:

/usr/bin/libtool -static i386/libchilkatIos.a x86_64/libchilkatIos.a 
  -o libchilkatSimIos.a

/usr/bin/libtool -static armv7s/libchilkatIos.a armv7/libchilkatIos.a arm64/libchilkatIos.a
   -o libchilkatIos.a

answered Sep 17 '15 at 10:11

chilkat's gravatar image

chilkat ♦♦

Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here



Answers and Comments

Markdown Basics

  • *italic* or __italic__
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported



Asked: Sep 17 '15 at 07:32

Seen: 2,439 times

Last updated: Sep 21 '15 at 12:12

powered by OSQA