我試圖在我的Fedora 22上快速工作。我遵循官方指示(https://swift.org/getting-started/#installing-swift)。 我能夠使用快捷REPL並執行快捷文件,而無需與swift main.swift
Linux Fedora swift符號查找錯誤
swift.main內容編譯它:
print("Hello, world!")
當我嘗試通過編譯它: swiftc main.swift -o main
我會出現以下錯誤:
[[email protected] 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的嗎?或者我錯過了什麼?
在此先感謝!
看看這個:https://github.com/thawkins/fedora-swift – Moritz
這看起來不錯,我會測試它,並告訴你它是如何工作的! – RoodRallec