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

Unresolved import direct2d::math #33

Open
canadaduane opened this issue Jan 26, 2019 · 5 comments
Open

Unresolved import direct2d::math #33

canadaduane opened this issue Jan 26, 2019 · 5 comments

Comments

@canadaduane
Copy link

I am (probably naively) trying to run "cargo build" on a fresh pull of piet and I'm seeing several errors in the build, e.g.:

error[E0432]: unresolved import `direct2d::math`
 --> piet-direct2d/src/conv.rs:3:15
  |
3 | use direct2d::math::{Matrix3x2F, Point2F, RectF};
  |               ^^^^ could not find `math` in `direct2d`

error[E0433]: failed to resolve: could not find `shared` in `winapi`
  --> piet-direct2d/src/lib.rs:11:13
   |
11 | use winapi::shared::basetsd::UINT32;
   |             ^^^^^^ could not find `shared` in `winapi`

error[E0433]: failed to resolve: could not find `um` in `winapi`
  --> piet-direct2d/src/lib.rs:12:13
   |
12 | use winapi::um::dcommon::D2D_SIZE_U;
   |             ^^ could not find `um` in `winapi`

I assume that as a new user of rust I just don't know what I'm doing :)

@raphlinus
Copy link
Contributor

This looks like trying to build windows-specific code on a non-windows platform. That shouldn't be happening. What platform are you on? Are you setting any features explicitly?

@canadaduane
Copy link
Author

canadaduane commented Jan 26, 2019 via email

@raphlinus
Copy link
Contributor

Ah, got it. Building the workspace tries to build all the subcrates, including direct2d, which isn't going to work. What should work is cargo run --example basic-cairo, assuming the Cairo prerequisites have been installed. We should probably update the README to reflect this.

We could also update the piet-direct2d crate so that nothing gets built on non-windows platforms.

@canadaduane
Copy link
Author

canadaduane commented Jan 26, 2019 via email

@SimonSapin
Copy link

Specifying default-members in the workspace’s manifest could help: https://doc.rust-lang.org/cargo/reference/manifest.html#package-selection

dianarg added a commit to dianarg/piet that referenced this issue Oct 31, 2019
dianarg added a commit to dianarg/piet that referenced this issue Oct 31, 2019
dianarg added a commit to dianarg/piet that referenced this issue Oct 31, 2019
cmyr pushed a commit that referenced this issue Nov 1, 2019
cmyr pushed a commit that referenced this issue Nov 1, 2019
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