无法使用 Postgres Adapter 和 Swift 3.1 构建 Kitura Server



我目前正在尝试构建一个访问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 et.al 在哪里。 指定? 我在哪里可以纠正这一点。 它不在包管理器文件中。

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)
    ]
)  

帮助或指向其他文档的指针将不胜感激。

原来我有一个旧版本的"kylef/swiftenv:Swift Version Manager"......我做了一个brew remove swiftgen,解决了问题。

我用这个命令找到了它...当我研究旧图书馆的来源时。

ls -l /usr/local/lib/libswift*

很多这样的结果 libswiftObjectiveC.dylib -> ../Cellar/swiftgen/2.0.0/lib/libswiftObjectiveC.dylib

最新更新