Skip to content

Demo Fails to Run with Rust Master and Cargo Nightly #224

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Closed
akesling opened this issue Dec 1, 2014 · 3 comments
Closed

Demo Fails to Run with Rust Master and Cargo Nightly #224

akesling opened this issue Dec 1, 2014 · 3 comments

Comments

@akesling
Copy link

akesling commented Dec 1, 2014

$ rustc --version
rustc 0.13.0-dev (09f04bf2c 2014-12-01 07:11:53 +0000)
$ cargo --version
cargo 0.0.1-pre-nightly (da789a6 2014-11-30 08:14:16 +0000)
$ cargo clean
$ # File path prefix removed for the following output.
$ cargo run --example demo 
   Compiling sdl2 v0.0.6 (file:///rust-sdl2)
src/sdl2/lib.rs:4:1: 4:27 warning: unused attribute, #[warn(unused_attributes)] on by default
src/sdl2/lib.rs:4 #![desc = "SDL2 bindings"]
                  ^~~~~~~~~~~~~~~~~~~~~~~~~~
src/sdl2/lib.rs:5:1: 5:20 warning: unused attribute, #[warn(unused_attributes)] on by default
src/sdl2/lib.rs:5 #![license = "MIT"]
                  ^~~~~~~~~~~~~~~~~~~
src/sdl2/lib.rs:4:1: 4:27 warning: unused attribute, #[warn(unused_attributes)] on by default
src/sdl2/lib.rs:4 #![desc = "SDL2 bindings"]
                  ^~~~~~~~~~~~~~~~~~~~~~~~~~
src/sdl2/lib.rs:5:1: 5:20 warning: unused attribute, #[warn(unused_attributes)] on by default
src/sdl2/lib.rs:5 #![license = "MIT"]
                  ^~~~~~~~~~~~~~~~~~~
rust-sdl2/examples/demo.rs:6:74: 6:98 error: unresolved name `sdl2::video::PosCentered`
rust-sdl2/examples/demo.rs:6     let window = match sdl2::video::Window::new("rust-sdl2 demo: Video", sdl2::video::PosCentered, sdl2::video::PosCentered, 800, 600, sdl2::video::OPENGL) {
                                                                                                                                       ^~~~~~~~~~~~~~~~~~~~~~~~
rust-sdl2/examples/demo.rs:6:100: 6:124 error: unresolved name `sdl2::video::PosCentered`
rust-sdl2/examples/demo.rs:6     let window = match sdl2::video::Window::new("rust-sdl2 demo: Video", sdl2::video::PosCentered, sdl2::video::PosCentered, 800, 600, sdl2::video::OPENGL) {
                                                                                                                                                                 ^~~~~~~~~~~~~~~~~~~~~~~~
rust-sdl2/examples/demo.rs:23:17: 23:34 error: unresolved enum variant, struct or const `Quit`
rust-sdl2/examples/demo.rs:23                 sdl2::event::Quit(_) => break 'main,
                                                                               ^~~~~~~~~~~~~~~~~
rust-sdl2/examples/demo.rs:24:17: 24:37 error: unresolved enum variant, struct or const `KeyDown`
rust-sdl2/examples/demo.rs:24                 sdl2::event::KeyDown(_, _, key, _, _, _) => {
                                                                               ^~~~~~~~~~~~~~~~~~~~
rust-sdl2/examples/demo.rs:29:17: 29:34 error: unresolved enum variant, struct or const `None`
rust-sdl2/examples/demo.rs:29                 sdl2::event::None => break 'event,
                                                                               ^~~~~~~~~~~~~~~~~
error: aborting due to 5 previous errors
Build failed, waiting for other jobs to finish...
Could not compile `sdl2`.

To learn more, run the command again with --verbose.

Any suggestions as to how I might debug? I'm rather new to Rust and don't yet know where to look when debugging tooling issues / linking bugs.

@jcmoyer
Copy link
Contributor

jcmoyer commented Dec 2, 2014

It seems these errors are related to rust-lang/rust#18973. I don't currently have an environment where I can build and test a patch, but these changes should do the trick:

  • sdl2::video::PosCentered needs to be replaced with sdl2::video::WindowPos::PosCentered
  • sdl2::event::Quit needs to be sdl2::event::Event::Quit
  • sdl2::event::KeyDown needs to be sdl2::event::Event::KeyDown
  • sdl2::event::None needs to be sdl2::event::Event::None

EDIT: Looks like the example didn't get fully updated in #209.

@AngryLawyer
Copy link
Member

I'll sort this out during my lunchbreak, cheers :)

@AngryLawyer
Copy link
Member

All fixed :)

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants