Ggez: Hello World example doesn't build

Created on 31 Aug 2019  路  2Comments  路  Source: ggez/ggez

Describe the bug
The hello world example doesn't build.

To Reproduce
copied and pasted the hello world example into a new project, then tried to build it.

Expected behavior
... I expected it to build.

Screenshots or pasted code
matt:~/code/my_first_ggez_app# cargo run
Compiling my_first_ggez_app v0.1.0 (/home/matt/code/my_first_ggez_app)
error[E0277]: the trait bound mint::vector::Point2<f32>: std::convert::From<cgmath::point::Point2<f32>> is not satisfied
--> src/main.rs:46:9
|
46 | graphics::draw(ctx, &self.text, (dest_point,))?;
| ^^^^^^^^^^^^^^ the trait std::convert::From<cgmath::point::Point2<f32>> is not implemented for mint::vector::Point2<f32>
|
= help: the following implementations were found:
as std::convert::From<[T; 2]>>
as std::convert::From>>
= note: required because of the requirements on the impl of std::convert::Into<mint::vector::Point2<f32>> for cgmath::point::Point2<f32>
= note: required because of the requirements on the impl of std::convert::From<(cgmath::point::Point2<f32>,)> for ggez::graphics::drawparam::DrawParam
= note: required because of the requirements on the impl of std::convert::Into<ggez::graphics::drawparam::DrawParam> for (cgmath::point::Point2<f32>,)
= note: required by ggez::graphics::draw

error: aborting due to previous error

For more information about this error, try rustc --explain E0277.
error: Could not compile my_first_ggez_app.

To learn more, run the command again with --verbose.
matt:~/code/my_first_ggez_app#

Hardware and Software:
This is with Stable 1.37 running in Linux

Type-DOCS bug

Most helpful comment

Ah, you need to tell the cgmath dependency in your Cargo.toml to use the mint feature, which is what ggez uses for math interoperability:

cgmath = {version= "0.17", features=["mint"]}

That needs to be explained better in the setup docs, thank you!

All 2 comments

Well that's problematic, let me take a look! Thanks for the report.

Ah, you need to tell the cgmath dependency in your Cargo.toml to use the mint feature, which is what ggez uses for math interoperability:

cgmath = {version= "0.17", features=["mint"]}

That needs to be explained better in the setup docs, thank you!

Was this page helpful?
0 / 5 - 0 ratings