我使用以下选项在Ubuntu上成功构建了swift (没有错误):
./utils/build-script --release --foundation --verbose-build --build-stdlib-deployment-targets all -l -b -p --skip-test-linux --build-swift-static-stdlib --build-swift-static-sdk-overlay --xctest -c我的目标是让Foundation成为静态编译的二进制文件。
如前所述,构建过程中的所有内容都运行良好,但是执行如下所示的简单脚本失败了。
import Foundation
print("Hello Swift.")我得到以下错误:
/bin/swiftc /home/hello.swift -o /home/hello
/home/hello.swift:1:8: error: no such module 'Foundation'你知道如何在linux上使用--foundation吗?
发布于 2017-05-28 17:00:54
非mac环境当前不支持基础框架,请参考此is it possible to build swift code using the foundation framework and target
https://stackoverflow.com/questions/41869723
复制相似问题