我目前正在尝试构建一个访问 Postgres 数据库的示例 Kitura 服务器。github 中有几个示例项目,最初由 IBM 发布。但是顶部有一个很大的评论说他们不再支持这个项目。
我正在使用的当前项目是 TodoList-SWiftKuery。
如说明中所述,我克隆项目并输入构建命令
swift build
链接步骤失败......这是事情开始失败时的控制台日志。当它开始变得多余时,我会剪掉它。
Linking ./.build/debug/Server
ld: warning: Auto-Linking supplied '/usr/local/lib/libswiftDispatch.dylib', /usr/local/lib/libswiftDispatch.dylib compiled with older version of Swift language (2.0) than previous files (3.0)
ld: warning: Auto-Linking supplied '/usr/local/lib/libswiftIOKit.dylib', /usr/local/lib/libswiftIOKit.dylib compiled with older version of Swift language (2.0) than previous files (3.0)
ld: warning: Auto-Linking supplied '/usr/local/lib/libswiftObjectiveC.dylib', /usr/local/lib/libswiftObjectiveC.dylib compiled with older version of Swift language (2.0) than previous files (3.0)
ld: warning: Auto-Linking supplied '/usr/local/lib/libswiftDarwin.dylib', /usr/local/lib/libswiftDarwin.dylib compiled with older version of Swift language (2.0) than previous files (3.0)
ld: warning: Auto-Linking supplied '/usr/local/lib/libswiftFoundation.dylib', /usr/local/lib/libswiftFoundation.dylib compiled with older version of Swift language (2.0) than previous files (3.0)
ld: warning: Auto-Linking supplied '/usr/local/lib/libswiftCoreGraphics.dylib', /usr/local/lib/libswiftCoreGraphics.dylib compiled with older version of Swift language (2.0) than previous files (3.0)
ld: warning: Auto-Linking supplied '/usr/local/lib/libswiftCore.dylib', /usr/local/lib/libswiftCore.dylib compiled with older version of Swift language (2.0) than previous files (3.0)
Undefined symbols for architecture x86_64:
"_OBJC_CLASS_$_SwiftObject", referenced from:
__TMC6Server6Config in Config.swift.o
__TMC9LoggerAPI3Log in Logger.swift.o
__TMC6Socket6Socket in Socket.swift.o
__TMC10SSLService10SSLService in SSLService.swift.o
__TMC9KituraNet10BufferList in BufferList.swift.o
__TMC9KituraNet13ClientRequest in ClientRequest.swift.o
__TMC9KituraNetP33_49D1A1CDD172EED7D059EF5A54A69CBD11CurlInvoker in ClientRequest.swift.o
我的基本问题是如何解决这个问题!
但一个具体的引入问题是,旧的 Swift 2.0 库等在哪里libswiftDispatch.dylib
。指定的?我在哪里可以纠正这个。它不在包管理器文件中。
import PackageDescription
let package = Package(
name: "TodoList",
targets: [
Target(
name: "Server",
dependencies: [.Target(name: "TodoList")]
),
Target(
name: "TodoList"
)
],
dependencies: [
.Package(url: "https://github.com/IBM-Swift/Kitura.git", majorVersion: 1),
.Package(url: "https://github.com/IBM-Swift/HeliumLogger.git", majorVersion: 1),
.Package(url: "https://github.com/IBM-Swift/Swift-cfenv.git", majorVersion: 1),
.Package(url: "https://github.com/IBM-Swift/Swift-Kuery-PostgreSQL.git", majorVersion: 0)
]
)
帮助或指向其他文档的指针将不胜感激。