9
ОС: Ubuntu 16,04Ошибка: Использование неразрешенного идентификатора 'процесса'
Swift Версия: 3.0 Preview 6
Я после этого getting started page
В greeter.swift
func sayHello(name: String) {
print("Hello, \(name)!")
}
в main.swift
if Process.arguments.count != 2 {
print("Usage: hello NAME")
} else {
let name = Process.arguments[1]
SayHello(name: name)
}
Ошибка получаю
$ swift build
Compile Swift Module 'myapp' (2 sources)
/Sources/main.swift:1:4: error: use of unresolved identifier 'Process'
if Process.arguments.count != 2 {
^~~~~~~
/Sources/main.swift:4:16: error: use of unresolved identifier 'Process'
let name = Process.arguments[1]
^~~~~~~
<unknown>:0: error: build had 1 command failures
error: exit(1): swift/bin/swift-build-tool -f .build/debug.yaml
CommandLine - это проект в GitHu b, а не часть базовой библиотеки Swift. https://github.com/jatoben/CommandLine –
Это сработало! Спасибо. – ECMAScript
@ChristianAbella: 'CommandLine' является частью ядра Swift 3: https://github.com/apple/swift/blob/master/stdlib/public/core/CommandLine.swift. См. Также https://github.com/jatoben/CommandLine/issues/77. –