Nannou: Build fails on Windows

Created on 20 Jan 2021  路  6Comments  路  Source: nannou-org/nannou

There are two errors, both related to the sample crate. It appears to be the same error in versions 0.9.1 and 0.10.0 of sample. I encountered this trying to run examples from the v0.15.0 release of nannou on Windows 10 with Rust 1.49.0.

error[E0282]: type annotations needed
  --> C:\Users\Zach\.cargo\registry\src\github.com-1ecc6299db9ec823\sample-0.10.0\src\window.rs:73:41
   |
73 |         let v = phase.to_float_sample().to_sample() * PI_2;
   |                                         ^^^^^^^^^ cannot infer type for type parameter `S` declared on the associated function `to_sample`
   |
help: consider specifying the type argument in the method call
   |
73 |         let v = phase.to_float_sample().to_sample::<S>() * PI_2;
   |                                                  ^^^^^

and

error[E0282]: type annotations needed
  --> C:\Users\Zach\.cargo\registry\src\github.com-1ecc6299db9ec823\sample-0.9.1\src\window.rs:73:41
   |
73 |         let v = phase.to_float_sample().to_sample() * PI_2;
   |                                         ^^^^^^^^^ cannot infer type for type parameter `S` declared on the associated function `to_sample`
   |
help: consider specifying the type argument in the method call
   |
73 |         let v = phase.to_float_sample().to_sample::<S>() * PI_2;
   |                                                  ^^^^^

error: could not compile `sample`

Most helpful comment

I believe this is the same as #699 鈥斅爐ldr, manually change examples/Cargo.toml to use version 0.3 of audrey. (PR #700 will fix it but isn't merged yet)

All 6 comments

I am running Rust 1.49 on Ubuntu 20.04. and Nannou v0.15.0

Compiling crossbeam-channel v0.4.4
Compiling wayland-sys v0.23.6
error[E0282]: type annotations needed
--> /home/schwaaweb/.cargo/registry/src/github.com-1ecc6299db9ec823/sample-0.9.1/src/window.rs:73:41
|
73 | let v = phase.to_float_sample().to_sample() * PI_2;
| ^^^^^^^^^ cannot infer type for type parameter S declared on the associated function to_sample
|
help: consider specifying the type argument in the method call
|
73 | let v = phase.to_float_sample().to_sample::() * PI_2;
| ^^^^^

error: aborting due to previous error

For more information about this error, try rustc --explain E0282.
error: could not compile sample

I believe this is the same as #699 鈥斅爐ldr, manually change examples/Cargo.toml to use version 0.3 of audrey. (PR #700 will fix it but isn't merged yet)

Because the examples are built along with nannou_audio (unless there's some way to disable this?) this also means that any new projects which depend on nannou_audio also cannot build... :(

i think this might be related to https://github.com/RustAudio/dasp/issues/141 since nannou_audio depends on dasp_sample

details: https://github.com/nannou-org/nannou/issues/704#issuecomment-780576625

Fix still not merged. I downloaded the latest version today and got the same issue

Thanks for the report! Closed via #665.

Was this page helpful?
0 / 5 - 0 ratings