Linux Fedora swift 符号查找错误

Linux Fedora swift symbol lookup error

我正在尝试让 swift 在我的 Fedora 22 上运行。我已按照官方说明 (https://swift.org/getting-started/#installing-swift) 进行操作。 我可以使用 swift REPL 并执行 swift 文件,而无需使用 swift main.swift

进行编译

swift.main内容:

print("Hello, world!")

当我试图通过以下方式编译它时: swiftc main.swift -o main 我收到以下错误:

[christian@roodrallec Sources]$ swiftc main.swift -o main -v
Swift version 2.2-dev (LLVM 46be9ff861, Clang 4deb154edc, Swift 778f82939c)
Target: x86_64-unknown-linux-gnu
/home/christian/Downloads/swift-2.2-SNAPSHOT-2015-12-01-b-ubuntu15.10/usr/bin/swift -frontend -c -primary-file main.swift -target x86_64-unknown-linux-gnu -disable-objc-interop -color-diagnostics -module-name main -o /tmp/main-dd738b.o
/home/christian/Downloads/swift-2.2-SNAPSHOT-2015-12-01-b-ubuntu15.10/usr/bin/swift-autolink-extract /tmp/main-dd738b.o -o /tmp/main-739e5f.autolink
/usr/bin/clang++ /tmp/main-dd738b.o -L /home/christian/Downloads/swift-2.2-SNAPSHOT-2015-12-01-b-ubuntu15.10/usr/lib/swift/linux -Xlinker -rpath -Xlinker /home/christian/Downloads/swift-2.2-SNAPSHOT-2015-12-01-b-ubuntu15.10/usr/lib/swift/linux -lswiftCore @/tmp/main-739e5f.autolink -Xlinker -T /home/christian/Downloads/swift-2.2-SNAPSHOT-2015-12-01-b-ubuntu15.10/usr/lib/swift/linux/x86_64/swift.ld -o main
/home/christian/Downloads/swift-2.2-SNAPSHOT-2015-12-01-b-ubuntu15.10/usr/lib/swift/linux/libswiftCore.so: undefined reference to `uiter_setUTF8_55'
/home/christian/Downloads/swift-2.2-SNAPSHOT-2015-12-01-b-ubuntu15.10/usr/lib/swift/linux/libswiftCore.so: undefined reference to `ucol_strcollIter_55'
/home/christian/Downloads/swift-2.2-SNAPSHOT-2015-12-01-b-ubuntu15.10/usr/lib/swift/linux/libswiftCore.so: undefined reference to `uiter_setString_55'
/home/christian/Downloads/swift-2.2-SNAPSHOT-2015-12-01-b-ubuntu15.10/usr/lib/swift/linux/libswiftCore.so: undefined reference to `ucol_next_55'
/home/christian/Downloads/swift-2.2-SNAPSHOT-2015-12-01-b-ubuntu15.10/usr/lib/swift/linux/libswiftCore.so: undefined reference to `ucol_closeElements_55'
/home/christian/Downloads/swift-2.2-SNAPSHOT-2015-12-01-b-ubuntu15.10/usr/lib/swift/linux/libswiftCore.so: undefined reference to `u_strToUpper_55'
/home/christian/Downloads/swift-2.2-SNAPSHOT-2015-12-01-b-ubuntu15.10/usr/lib/swift/linux/libswiftCore.so: undefined reference to `ucol_strcoll_55'
/home/christian/Downloads/swift-2.2-SNAPSHOT-2015-12-01-b-ubuntu15.10/usr/lib/swift/linux/libswiftCore.so: undefined reference to `ucol_open_55'
/home/christian/Downloads/swift-2.2-SNAPSHOT-2015-12-01-b-ubuntu15.10/usr/lib/swift/linux/libswiftCore.so: undefined reference to `u_strToLower_55'
/home/christian/Downloads/swift-2.2-SNAPSHOT-2015-12-01-b-ubuntu15.10/usr/lib/swift/linux/libswiftCore.so: undefined reference to `ucol_openElements_55'
/home/christian/Downloads/swift-2.2-SNAPSHOT-2015-12-01-b-ubuntu15.10/usr/lib/swift/linux/libswiftCore.so: undefined reference to `ucol_setAttribute_55'
clang: error: linker command failed with exit code 1 (use -v to see invocation)
<unknown>:0: error: link command failed with exit code 1 (use -v to see invocation)

是吗,因为二进制文件是针对 Ubuntu 的?或者我错过了什么?

提前致谢!

您可能知道,这些错误表明 Swift 需要一些符号,很可能是函数,但在任何正在使用的库中都不可用。函数名称并没有引起我的注意,所以我真的不知道如何解决这些特定错误。

我认为此时您可能想尝试从源代码构建 Swift,如此处所述:https://github.com/apple/swift/blob/master/README.md。在 Fedora 上使用 Ubuntu 二进制文件可能不是一个好主意。即使您克服了这些错误,以后也可能会出现其他问题。

我还没有尝试从源代码构建 Swift,因此无法真正分享这方面的任何经验。