我在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"]
答案 0 :(得分:0)
你需要libgcc - * - dev软件包,它提供了crtbegin.o以及一些对在Ubuntu上构建程序至关重要的其他重要库和目标文件。例如,在Ubuntu 14.04上它将是libgcc-4.8-dev。如果您安装gcc软件包,则应安装软件包:
apt-get install gcc