编译 alamofire 的错误 - 未知选项字符“X”在:-Xlinker
Posted
技术标签:
【中文标题】编译 alamofire 的错误 - 未知选项字符“X”在:-Xlinker【英文标题】:bug compiling alamofire - unknown option character `X' in: -Xlinker 【发布时间】:2015-01-31 04:01:14 【问题描述】:尝试将 alamofire 添加到使用 cocoapods 的项目中。 Xcode 版本:版本 6.1.1 (6A2008a)
Pod 文件:
source 'https://github.com/CocoaPods/Specs.git'
platform :ios, '8.0'
pod 'OAuth.io'
pod 'Alamofire', '~> 1.1'
这是错误:
Libtool /Users/tony/Library/Developer/Xcode/DerivedData/Candytone-aynufizixrzmtwgatrvrjynlonxv/Build/Products/Debug-iphonesimulator/libPods-Alamofire.a normal x86_64
cd /Users/tony/src/candytone-ios/Candytone/Pods
export IPHONEOS_DEPLOYMENT_TARGET=8.1
export PATH="/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin:/Applications/Xcode.app/Contents/Developer/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin"
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/libtool -static -arch_only x86_64 -syslibroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator8.1.sdk -L/Users/tony/Library/Developer/Xcode/DerivedData/Candytone-aynufizixrzmtwgatrvrjynlonxv/Build/Products/Debug-iphonesimulator -filelist /Users/tony/Library/Developer/Xcode/DerivedData/Candytone-aynufizixrzmtwgatrvrjynlonxv/Build/Intermediates/Pods.build/Debug-iphonesimulator/Pods-Alamofire.build/Objects-normal/x86_64/Pods-Alamofire.LinkFileList -L/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator -Xlinker -add_ast_path -Xlinker /Users/tony/Library/Developer/Xcode/DerivedData/Candytone-aynufizixrzmtwgatrvrjynlonxv/Build/Intermediates/Pods.build/Debug-iphonesimulator/Pods-Alamofire.build/Objects-normal/x86_64/Pods_Alamofire.swiftmodule -framework Foundation -o /Users/tony/Library/Developer/Xcode/DerivedData/Candytone-aynufizixrzmtwgatrvrjynlonxv/Build/Products/Debug-iphonesimulator/libPods-Alamofire.a
error: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/libtool: unknown option character `X' in: -Xlinker
Usage: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/libtool -static [-] file [...] [-filelist listfile[,dirname]] [-arch_only arch] [-sacLT] [-no_warning_for_no_symbols]
Usage: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/libtool -dynamic [-] file [...] [-filelist listfile[,dirname]] [-arch_only arch] [-o output] [-install_name name] [-compatibility_version #] [-current_version #] [-seg1addr 0x#] [-segs_read_only_addr 0x#] [-segs_read_write_addr 0x#] [-seg_addr_table <filename>] [-seg_addr_table_filename <file_system_path>] [-all_load] [-noall_load]
【问题讨论】:
关注这个问题:***.com/questions/19693769/… 【参考方案1】:升级到 Cocoapods 0.36beta 解决了这个问题。
gem install cocoapods --pre
我还必须删除旧版本。
gem uninstall cocoapods
【讨论】:
谢谢!它帮助了我。我要补充一点,在我的情况下,我必须从我的项目中删除 pod 并重新安装它 我必须将use_frameworks!
添加到我的 podfile - 否则解决方案有效。
更新:cocoapods 0.36 已发布,所以只需执行gem install cocoapods
并在您的Podfile
中添加use_frameworks!
。警告:不是 100% 当前的 pods 支持框架——当时我会远离 swift pods。
关注这个问题:***.com/questions/19693769/…以上是关于编译 alamofire 的错误 - 未知选项字符“X”在:-Xlinker的主要内容,如果未能解决你的问题,请参考以下文章
Angular 2 提前编译中的未知编译器选项“angularCompilerOptions”
Laravel Mix 未知选项“--hide-modules”错误