2

My work is blocked by 'ld: warning: URGENT: building for iOS simulator, but linking in object file built for OSX' or vice versa, so I want to find out which platform a lib was built for.

I tried:

file tmp/openssl/lib/libcrypto.dylib
lipo -info tmp/openssl/lib/libcrypto.dylib
otool -hv -arch all tmp/openssl/lib/libcrypto.a
otool -hv -arch all /usr/local/opt/openssl/lib/libcrypto.a

and only thing I got is CPU type x86_64 or i386.

haolun
  • 304
  • 1
  • 9

1 Answers1

1

As originally described in this post, you can run otool -l /path/to/binary and inspect output for 'Load' commands. Output should contain LC_VERSION_MIN_IPHONEOS command for iOS binaries, and LC_VERSION_MIN_MACOSX for macOS.

toma
  • 1,471
  • 12
  • 20