4

我正在关注这个 Rust 教程,并且正在努力编译第一个基本项目。我正在使用 Fedora,但我是新手。

$ cargo build --verbose
   Compiling sdl2-sys v0.5.0
     Running `rustc /home/batisteo/.cargo/registry/src/github.com-1ecc6299db9ec823/sdl2-sys-0.5.0/build.rs --crate-name build_script_build --crate-type bin -C prefer-dynamic -g --cfg feature="default" --out-dir /home/batisteo/arcade-rs/target/debug/build/sdl2-sys-d9571ac1c4bc4261 --emit=dep-info,link -L dependency=/home/batisteo/arcade-rs/target/debug/deps -L dependency=/home/batisteo/arcade-rs/target/debug/deps -Awarnings`
   Fresh libc v0.1.8
   Fresh bitflags v0.2.1
   Fresh rustc-serialize v0.3.15
   Fresh rand v0.3.8
   Fresh num v0.1.25
error: could not exec the linker `cc`: No such file or directory (os error 2)
error: aborting due to previous error
Could not compile `sdl2-sys`.

Caused by:
  Process didn't exit successfully: `rustc /home/batisteo/.cargo/registry/src/github.com-1ecc6299db9ec823/sdl2-sys-0.5.0/build.rs --crate-name build_script_build --crate-type bin -C prefer-dynamic -g --cfg feature="default" --out-dir /home/batisteo/arcade-rs/target/debug/build/sdl2-sys-d9571ac1c4bc4261 --emit=dep-info,link -L dependency=/home/batisteo/arcade-rs/target/debug/deps -L dependency=/home/batisteo/arcade-rs/target/debug/deps -Awarnings` (exit code: 101)

在安装 SDL 之前或之后我有相同的输入:

$ sudo dnf install SDL2-devel
4

1 回答 1

5

你有安装 C 编译器吗?在我看来,它像是在抱怨cc

于 2015-07-07T22:15:45.363 回答