简体   繁体   English

xcode> = 8无法编译我的Objective-C库

[英]xcode >= 8 cannot compile my objective-c library

I'm trying to compile my objective-c library with Xcode (or xcodebuild) but it seems that Xcode is only taking the last two numbers of my "Base SDK" (10.1 in my case) build setting : 我正在尝试使用Xcode(或xcodebuild)来编译我的Objective-c库,但似乎Xcode只采用了我的“ Base SDK”(在我的情况下为10.1)构建设置的最后两个数字:

xcodebuild   -scheme mylib   -workspace mylib_objc.xcworkspace -sdk "iphonesimulator10.1" build

output error : 输出错误:

    /bin/sh -c /Users/user/Library/Developer/Xcode/DerivedData/mylib_objc-dcainaehwbdhdeeyoykilqflodnx/Build/Intermediates/mylib.build/Debug-iphonesimulator/mylib.build/Script-AEDFEE9B1B25C0FD00756827.sh
XCode has selected SDK: iphonesimulator with version: 0.1 (although back-targetting: 7.0)
...therefore, OTHER_SDK_TO_BUILD = iphoneos0.1
RECURSION: I am the root ... recursing all missing build targets NOW...
RECURSION: ...about to invoke: xcodebuild -configuration "Debug" -project "mylib.xcodeproj" -target "mylib" -sdk "iphoneos0.1" build RUN_CLANG_STATIC_ANALYZER=NO BUILD_DIR="/Users/user/Library/Developer/Xcode/DerivedData/mylib_objc-dcainaehwbdhdeeyoykilqflodnx/Build/Products" BUILD_ROOT="/Users/user/Library/Developer/Xcode/DerivedData/mylib_objc-dcainaehwbdhdeeyoykilqflodnx/Build/Products" SYMROOT="/Users/user/Library/Developer/Xcode/DerivedData/mylib_objc-dcainaehwbdhdeeyoykilqflodnx/Build/Products"
xcodebuild: error: SDK "iphoneos0.1" cannot be located.
Command /bin/sh failed with exit code 64

I then tried with a coworker who has xCode 8 (and therefore base sdk=10.0), the error was xcodebuild: error: SDK "iphoneos0.0" cannot be located. 然后,我尝试了一个具有xCode 8(因此基本sdk = 10.0)的同事,该错误是xcodebuild: error: SDK "iphoneos0.0" cannot be located.

Any idea how to force the compilation ? 知道如何强制编译吗?

You are buiding your library with an old build script. 您正在使用旧的构建脚本来构建库。 Checkout my answer here 在这里查看我的答案

Build fat static library (device + simulator) using Xcode and SDK 4+ 使用Xcode和SDK 4+构建胖静态库(设备+模拟器)

and update your script then you should be fine. 并更新脚本,然后就可以了。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM