我试图在可可静态库中使用swift,但编译器正在向我吐口水:
Libtool /Users/USERNAME/Library/Developer/Xcode/DerivedData/SwiftFramework-gmerfrjnryqwvmbjvschjjxdjyvs/Build/Products/Debug-iphoneos/libSwiftFramework.a normal arm64
cd /Users/USERNAME/Code/Examples/SwiftFramework
export IPHONEOS_DEPLOYMENT_TARGET=8.1
export PATH="/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.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 arm64 -syslibroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk -L/Users/USERNAME/Library/Developer/Xcode/DerivedData/SwiftFramework-gmerfrjnryqwvmbjvschjjxdjyvs/Build/Products/Debug-iphoneos -filelist /Users/USERNAME/Library/Developer/Xcode/DerivedData/SwiftFramework-gmerfrjnryqwvmbjvschjjxdjyvs/Build/Intermediates/SwiftFramework.build/Debug-iphoneos/SwiftFramework.build/Objects-normal/arm64/SwiftFramework.LinkFileList -L/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphoneos -Xlinker -add_ast_path -Xlinker /Users/USERNAME/Library/Developer/Xcode/DerivedData/SwiftFramework-gmerfrjnryqwvmbjvschjjxdjyvs/Build/Intermediates/SwiftFramework.build/Debug-iphoneos/SwiftFramework.build/Objects-normal/arm64/SwiftFramework.swiftmodule -o /Users/USERNAME/Library/Developer/Xcode/DerivedData/SwiftFramework-gmerfrjnryqwvmbjvschjjxdjyvs/Build/Products/Debug-iphoneos/libSwiftFramework.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]
这是通过创建一个新项目来实现的,该项目是Cocoa Touch静态库,然后向目标添加一个空的swift文件。
unknown option character `X' in: -Xlinker
在静态库中尝试此操作时有没有人看过这个?