Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Could not find piston in backend #953

Closed
TomboFry opened this issue Feb 20, 2017 · 3 comments
Closed

Could not find piston in backend #953

TomboFry opened this issue Feb 20, 2017 · 3 comments

Comments

@TomboFry
Copy link

I have gotten to the point in my project where I have everything set up to draw a GUI using piston_window as a backend. At first I noticed nothing drew to the screen. I have widgets being successfully created on event.update inside the while let Some(event) = window.next() loop, though I realised the GUI itself is not being drawn inside the window.draw_2d function.

I'm not entirely sure if this is correct as I'm looking at code from the all_piston_window.rs example, but I also need to include a conrod::backend::piston::draw::primitives() function inside of the draw function mentioned earlier, but no matter what I put after conrod::backend (including piston, piston_window, winit and glium) I get an error compiling every time saying "Could not find `piston` in `backend`". I've checked the source - it's all right there, but it just doesn't seem to get picked up by the compiler?

I have tried adding --features "piston" to cargo run but it still fails on me. I have these libraries in my dependencies in order to get everything running fine, apart from this single error.

piston="^0.31.3"
piston_window="^0.61.0"
conrod="^0.51.1"
find_folder="^0.3.0"

Is there something I'm missing? I can provide more source code if necessary, though it's quite similar to the example I linked to above.

@mitchmindtree
Copy link
Contributor

Hey @TomboFry, --features "piston" will only work when trying to run or compile conrod or its examples directly. If you'd like to activate the piston feature when using conrod as a dependency, the conrod entry under your [dependencies] list should look like this:

conrod = { version = "^0.51.1", features = "piston" }

Hope this helps!

@TomboFry
Copy link
Author

Ahhhh, yes, that makes complete sense! I noticed in the backend/mod.rs file it has #[cfg(feature="piston")] so I knew it would go somewhere, but I did not consider the config file as you suggested.

I got it working by turning features = "piston" into an array, thank you very much for the help.

@flajann2
Copy link

flajann2 commented Jul 9, 2017

conrod = { version = "^0.51.1", features = ["piston"] }

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

No branches or pull requests

3 participants