sunjay / turtle

Create Animated Drawings in Rust
http://turtle.rs
Mozilla Public License 2.0
559 stars 54 forks source link

can not build #252

Closed MrZLeo closed 2 years ago

MrZLeo commented 2 years ago

When I am trying to build my pure new project with turtle, I received error:

error[E0308]: mismatched types
   --> /Users/mrzleo/.cargo/registry/src/github.com-1ecc6299db9ec823/winit-0.19.5/src/platform/macos/view.rs:209:9
    |
205 | extern fn has_marked_text(this: &Object, _sel: Sel) -> BOOL {
    |                                                        ---- expected `bool` because of return type
...
209 |         (marked_text.length() > 0) as i8
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `bool`, found `i8`

error[E0308]: mismatched types
   --> /Users/mrzleo/.cargo/registry/src/github.com-1ecc6299db9ec823/winit-0.19.5/src/platform/macos/window.rs:103:26
    |
103 |             is_zoomed != 0
    |                          ^ expected `bool`, found integer

error[E0308]: mismatched types
   --> /Users/mrzleo/.cargo/registry/src/github.com-1ecc6299db9ec823/winit-0.19.5/src/platform/macos/window.rs:175:57
    |
175 |                 self.window.setFrame_display_(new_rect, 0);
    |                                                         ^ expected `bool`, found integer

error[E0308]: mismatched types
    --> /Users/mrzleo/.cargo/registry/src/github.com-1ecc6299db9ec823/winit-0.19.5/src/platform/macos/window.rs:1301:48
     |
1301 |         window.setFrame_display_(current_rect, 0)
     |                                                ^ expected `bool`, found integer

error[E0308]: mismatched types
    --> /Users/mrzleo/.cargo/registry/src/github.com-1ecc6299db9ec823/winit-0.19.5/src/platform/macos/window.rs:1308:48
     |
1308 |         window.setFrame_display_(current_rect, 0)
     |                                                ^ expected `bool`, found integer

error[E0308]: mismatched types
    --> /Users/mrzleo/.cargo/registry/src/github.com-1ecc6299db9ec823/winit-0.19.5/src/platform/macos/window.rs:1325:48
     |
1325 |         window.setFrame_display_(current_rect, 0)
     |                                                ^ expected `bool`, found integer

error[E0308]: mismatched types
    --> /Users/mrzleo/.cargo/registry/src/github.com-1ecc6299db9ec823/winit-0.19.5/src/platform/macos/window.rs:1332:48
     |
1332 |         window.setFrame_display_(current_rect, 0)
     |                                                ^ expected `bool`, found integer

    Checking pistoncore-window v0.44.0
For more information about this error, try `rustc --explain E0308`.
error: could not compile `winit` due to 7 previous errors
warning: build failed, waiting for other jobs to finish...
error: build failed

This error came from dependency winit.

My device: macOS Monterey aarch64 rustc:rustc 1.56.1 (59eed8a2a 2021-11-01) turtle:turtle = "1.0.0-rc.3"

sunjay commented 2 years ago

Hi, sorry for the trouble you're experiencing. The crate published on crates.io is very old due to #183. Try using the master branch instead and see if that works. In your Cargo.toml file:

turtle = {git = "https://github.com/sunjay/turtle"}
MrZLeo commented 2 years ago

Hi, sorry for the trouble you're experiencing. The crate published on crates.io is very old due to #183. Try using the master branch instead and see if that works. In your Cargo.toml file:

turtle = {git = "https://github.com/sunjay/turtle"}

Thanks a lot! It works perfectly now!!!