【发布时间】:2018-03-05 20:57:44
【问题描述】:
我正在尝试熟悉 Swift 包管理器。 我就是这样做的:
swift package init --type executable
- 在 Package.swift 中添加了一个依赖项
swift build
一切都很好,但是在我尝试在代码中import Dependency 之后,xcode 说:没有这样的模块。
我的 Package.swift 看起来像:
import PackageDescription
let package = Package(
name: "todo-bot",
dependencies: [
// Dependencies declare other packages that this package depends on.
// .package(url: /* package url */, from: "1.0.0"),
.package(url: "https://github.com/zmeyc/telegram-bot-swift.git", from: "0.0.0")
],
targets: [
// Targets are the basic building blocks of a package. A target can define a module or a test suite.
// Targets can depend on other targets in this package, and on products in packages which this package depends on.
.target(
named: "todo-bot",
dependencies: ["telegram-bot-swift"]),
]
)
当我尝试在没有 xcode 的情况下构建它时
- 编译 Swift 模块“SwiftyJSON”(2 个来源)
- 编译 Swift 模块“ScannerUtils”(2 个来源)
- 编译 Swift 模块“TelegramBot”(135 个来源)
- 编译 Swift 模块“todo_bot”(1 个来源)
/opt/local/include/curl/system.h:399:12:注意:在构建从 /opt/local/include/curl/system.h:399 导入的模块“Darwin”时:
#包括 ^ :338:9:注意:在文件中包含:338:#import "ncurses.h" ^ /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk/usr/include/ncurses.h:141:10:注意:在/Applications/Xcode中包含的文件中。 app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk/usr/include/ncurses.h:141:#包括 ^ /opt/local/include/unctrl.h:60:63:错误:未知类型名称“屏幕” NCURSES_EXPORT(NCURSES_CONST char ) NCURSES_SP_NAME(unctrl) (SCREEN, chtype); ^ /opt/local/include/curl/system.h:399:12:注意:在构建从 /opt/local/include/curl/system.h:399 导入的模块“Darwin”时: '#' 包括 ^
【问题讨论】:
-
this 类似的问题有帮助吗?请记住,谷歌是你的朋友,在这个网站上,你最好能告诉人们你自己已经完成了哪些研究。您通过谷歌搜索找到的内容应该很突出。
-
什么依赖?您的包定义如何?请使用这些详细信息更新问题(至少)
标签: swift swift4 swift-package-manager