sdl2-sys不会编译 - 无法执行链接器:没有这样的文件或目录

时间:2015-07-07 20:47:18

标签: rust fedora sdl-2 rust-cargo

我跟随this Rust tutorial并且正在努力编译第一个基本项目。我正在使用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

1 个答案:

答案 0 :(得分:5)

您是否安装了C编译器?在我看来,它正在抱怨cc