我正在运行 Xcode 8.0 构建版本 8S174q 和 Apple Swift 版本 3.0 (swiftlang-800.0.34.6 clang-800.0.33)。
Pauls-Mac-mini:~ paul$ xcrun xcodebuild -version
Xcode 8.0
Build version 8S174q
Pauls-Mac-mini:~ paul$ xcrun swift -version
Apple Swift version 3.0 (swiftlang-800.0.34.6 clang-800.0.33)
Target: x86_64-apple-macosx10.9
Pauls-Mac-mini:~ paul$ xcrun --find swift
/Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/swift
从https://github.com/stephencelis/SQLite.swift我安装了 0.11.0 版本(注意它是用 Swift 3 编写的)。我已经在该网页上尝试了三种安装方法,经过一天的折腾仍然无法编译 sqlite.swift。通过 Xcode Report Navigator (CMD-8),我看到了数百个编译错误,其中一些我已粘贴在下面。
/Users/paul/Documents/MySandbox/TestThreeSqlite/SQLite.swift/SQLite/Core/Connection.swift:69:9: error: expected declaration
fileprivate init(rawValue:Int32) {
^
/Users/paul/Documents/MySandbox/TestThreeSqlite/SQLite.swift/SQLite/Core/Connection.swift:58:17: note: in declaration of 'Operation'
public enum Operation {
^
/Users/paul/Documents/MySandbox/TestThreeSqlite/SQLite.swift/SQLite/Core/Connection.swift:69:20: error: consecutive declarations on a line must be separated by ';'
fileprivate init(rawValue:Int32) {
^
我最初怀疑没有使用 swift 3.0 编译器,但通过查看编译命令(如下)似乎并非如此。
我尝试了 3 种安装 SQLite.swift 的方法——使用 Carthage、cocoapods 并将 SQLite.swift 作为 Xcode 子项目安装。我无法构建 SQlite.swift。
请帮忙!我是 iOS 开发、Xcode 和工具的新手,所以对此感到困惑。下面我添加了一些更详细的信息,例如生成错误的编译命令。你能建议一个可能的解决方案,甚至是我可以尝试构建这个子项目的东西吗?
CompileSwift normal x86_64 /Users/paul/Documents/MySandbox/TestThreeSqlite/SQLite.swift/SQLite/Typed/CoreFunctions.swift
cd /Users/paul/Documents/MySandbox/TestThreeSqlite/SQLite.swift
/Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/swift -frontend -c -primary-file /Users/paul/Documents/MySandbox/TestThreeSqlite/SQLite.swift/SQLite/Typed/CoreFunctions.swift /Users/paul/Documents/MySandbox/TestThreeSqlite/SQLite.swift/SQLite/Extensions/RTree.swift /Users/paul/Documents/MySandbox/TestThreeSqlite/SQLite.swift/SQLite/Core/Blob.swift /Users/paul/Documents/MySandbox/TestThreeSqlite/SQLite.swift/SQLite/Foundation.swift /Users/paul/Documents/MySandbox/TestThreeSqlite/SQLite.swift/SQLite/Core/Connection.swift /Users/paul/Documents/MySandbox/TestThreeSqlite/SQLite.swift/SQLite/Typed/Expression.swift /Users/paul/Documents/MySandbox/TestThreeSqlite/SQLite.swift/SQLite/Helpers.swift /Users/paul/Documents/MySandbox/TestThreeSqlite/SQLite.swift/SQLite/Typed/Collation.swift /Users/paul/Documents/MySandbox/TestThreeSqlite/SQLite.swift/SQLite/Typed/Setter.swift /Users/paul/Documents/MySandbox/TestThreeSqlite/SQLite.swift/SQLite/Typed/CustomFunctions.swift /Users/paul/Documents/MySandbox/TestThreeSqlite/SQLite.swift/SQLite/Extensions/FTS4.swift /Users/paul/Documents/MySandbox/TestThreeSqlite/SQLite.swift/SQLite/Core/Value.swift /Users/paul/Documents/MySandbox/TestThreeSqlite/SQLite.swift/SQLite/Typed/Operators.swift /Users/paul/Documents/MySandbox/TestThreeSqlite/SQLite.swift/SQLite/Typed/Schema.swift /Users/paul/Documents/MySandbox/TestThreeSqlite/SQLite.swift/SQLite/Typed/Query.swift /Users/paul/Documents/MySandbox/TestThreeSqlite/SQLite.swift/SQLite/Core/Statement.swift /Users/paul/Documents/MySandbox/TestThreeSqlite/SQLite.swift/SQLite/Typed/AggregateFunctions.swift /Users/paul/Documents/MySandbox/TestThreeSqlite/SQLite.swift/SQLite/Extensions/FTS5.swift -target x86_64-apple-ios10.0 -enable-objc-interop -sdk /Applications/Xcode-beta.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator10.0.sdk -I /Users/paul/Library/Developer/Xcode/DerivedData/TestThreeSqlite-hfrusllbfhbivxajwyfswvzejkpl/Build/Products/Debug-iphonesimulator -I /Users/paul/Documents/MySandbox/TestThreeSqlite/SQLite.swift/CocoaPods/iphonesimulator-10.0 -F /Users/paul/Library/Developer/Xcode/DerivedData/TestThreeSqlite-hfrusllbfhbivxajwyfswvzejkpl/Build/Products/Debug-iphonesimulator -application-extension -enable-testing -g -import-underlying-module -module-cache-path /Users/paul/Library/Developer/Xcode/DerivedData/ModuleCache -serialize-debugging-options -Xcc "-I/Users/paul/Library/Developer/Xcode/DerivedData/TestThreeSqlite-hfrusllbfhbivxajwyfswvzejkpl/Build/Intermediates/SQLite.build/Debug-iphonesimulator/SQLite iOS.build/swift-overrides.hmap" -Xcc -iquote -Xcc "/Users/paul/Library/Developer/Xcode/DerivedData/TestThreeSqlite-hfrusllbfhbivxajwyfswvzejkpl/Build/Intermediates/SQLite.build/Debug-iphonesimulator/SQLite iOS.build/SQLite-generated-files.hmap" -Xcc "-I/Users/paul/Library/Developer/Xcode/DerivedData/TestThreeSqlite-hfrusllbfhbivxajwyfswvzejkpl/Build/Intermediates/SQLite.build/Debug-iphonesimulator/SQLite iOS.build/SQLite-own-target-headers.hmap" -Xcc "-I/Users/paul/Library/Developer/Xcode/DerivedData/TestThreeSqlite-hfrusllbfhbivxajwyfswvzejkpl/Build/Intermediates/SQLite.build/Debug-iphonesimulator/SQLite iOS.build/SQLite-all-non-framework-target-headers.hmap" -Xcc -ivfsoverlay -Xcc /Users/paul/Library/Developer/Xcode/DerivedData/TestThreeSqlite-hfrusllbfhbivxajwyfswvzejkpl/Build/Intermediates/SQLite.build/all-product-headers.yaml -Xcc -iquote -Xcc "/Users/paul/Library/Developer/Xcode/DerivedData/TestThreeSqlite-hfrusllbfhbivxajwyfswvzejkpl/Build/Intermediates/SQLite.build/Debug-iphonesimulator/SQLite iOS.build/SQLite-project-headers.hmap" -Xcc -I/Users/paul/Library/Developer/Xcode/DerivedData/TestThreeSqlite-hfrusllbfhbivxajwyfswvzejkpl/Build/Products/Debug-iphonesimulator/include -Xcc "-I/Users/paul/Library/Developer/Xcode/DerivedData/TestThreeSqlite-hfrusllbfhbivxajwyfswvzejkpl/Build/Intermediates/SQLite.build/Debug-iphonesimulator/SQLite iOS.build/DerivedSources/x86_64" -Xcc "-I/Users/paul/Library/Developer/Xcode/DerivedData/TestThreeSqlite-hfrusllbfhbivxajwyfswvzejkpl/Build/Intermediates/SQLite.build/Debug-iphonesimulator/SQLite iOS.build/DerivedSources" -Xcc -DDEBUG=1 -Xcc -ivfsoverlay -Xcc "/Users/paul/Library/Developer/Xcode/DerivedData/TestThreeSqlite-hfrusllbfhbivxajwyfswvzejkpl/Build/Intermediates/SQLite.build/Debug-iphonesimulator/SQLite iOS.build/unextended-module-overlay.yaml" -Xcc -working-directory/Users/paul/Documents/MySandbox/TestThreeSqlite/SQLite.swift -emit-module-doc-path "/Users/paul/Library/Developer/Xcode/DerivedData/TestThreeSqlite-hfrusllbfhbivxajwyfswvzejkpl/Build/Intermediates/SQLite.build/Debug-iphonesimulator/SQLite iOS.build/Objects-normal/x86_64/CoreFunctions~partial.swiftdoc" -Onone -module-name SQLite -emit-module-path "/Users/paul/Library/Developer/Xcode/DerivedData/TestThreeSqlite-hfrusllbfhbivxajwyfswvzejkpl/Build/Intermediates/SQLite.build/Debug-iphonesimulator/SQLite iOS.build/Objects-normal/x86_64/CoreFunctions~partial.swiftmodule" -serialize-diagnostics-path "/Users/paul/Library/Developer/Xcode/DerivedData/TestThreeSqlite-hfrusllbfhbivxajwyfswvzejkpl/Build/Intermediates/SQLite.build/Debug-iphonesimulator/SQLite iOS.build/Objects-normal/x86_64/CoreFunctions.dia" -emit-dependencies-path "/Users/paul/Library/Developer/Xcode/DerivedData/TestThreeSqlite-hfrusllbfhbivxajwyfswvzejkpl/Build/Intermediates/SQLite.build/Debug-iphonesimulator/SQLite iOS.build/Objects-normal/x86_64/CoreFunctions.d" -emit-reference-dependencies-path "/Users/paul/Library/Developer/Xcode/DerivedData/TestThreeSqlite-hfrusllbfhbivxajwyfswvzejkpl/Build/Intermediates/SQLite.build/Debug-iphonesimulator/SQLite iOS.build/Objects-normal/x86_64/CoreFunctions.swiftdeps" -o "/Users/paul/Library/Developer/Xcode/DerivedData/TestThreeSqlite-hfrusllbfhbivxajwyfswvzejkpl/Build/Intermediates/SQLite.build/Debug-iphonesimulator/SQLite iOS.build/Objects-normal/x86_64/CoreFunctions.o"