首页 文章

Linux Fedora swift符号查找错误

提问于
浏览
1

我'm trying to get swift working on my Fedora 22. I' ve遵循官方指示(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?或者我错过了什么?

提前致谢!

1 回答

  • 0

    您可能知道,错误表明Swift需要一些符号,很可能是函数,但在任何正在使用的库中都不可用 . 函数名称没有响铃,所以我无法告诉如何解决这些特定的错误 .

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

    我还没有尝试过从源代码构建Swift,因此无法真正分享任何经验 .

相关问题