我在 ubuntu 中创建了一个新项目,只有 main.swift
,有一个简单的 print(hello world)
并显示这个错误。
guillermo@guillermo-Latitude-E6440:~/Descargas/Hola3$ swift build
Linking Executable: .build/debug/Hola3
/usr/bin/ld: cannot find crtbegin.o: No such file or directory
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)
<unknown>:0: error: build had 1 command failures
error: exit(1): ["/home/guillermo/Descargas/swift-DEVELOPMENT-SNAPSHOT-2016-01-25-a-ubuntu14.04/usr/bin/swift-build-tool", "-f", "/home/guillermo/Descargas/Hola3/.build/debug/Hola3.o/llbuild.yaml"]
最佳答案
您需要 libgcc-*-dev 软件包,它提供了 crtbegin.o 和其他一些对在 Ubuntu 上构建程序至关重要的重要库和目标文件。例如,在 Ubuntu 14.04 上它将是 libgcc-4.8-dev。如果安装 gcc 包,则应安装该包:
apt-get install gcc
关于swift - 在 ubuntu 14.04 中快速安装时出错,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35851593/