Skip to content
New issue

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

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

Already on GitHub? # to your account

Cargo build fails on project root. Cannot run android sample. #200

Open
nicoabie opened this issue Jul 30, 2020 · 2 comments
Open

Cargo build fails on project root. Cannot run android sample. #200

nicoabie opened this issue Jul 30, 2020 · 2 comments

Comments

@nicoabie
Copy link

ngallinal@ITs-Mac-mini-2 surfman % cargo build
warning: profiles for the non root package will be ignored, specify profiles at the workspace root:
package:   /Users/ngallinal/Development/surfman/android-example/rust/Cargo.toml
workspace: /Users/ngallinal/Development/surfman/Cargo.toml
   Compiling surfman_android_threads v0.1.0 (/Users/ngallinal/Development/surfman/android-example/rust)
error[E0433]: failed to resolve: use of undeclared type or module `winit`
  --> android-example/rust/src/../../../surfman/examples/threads.rs:20:5
   |
20 | use winit::dpi::PhysicalSize;
   |     ^^^^^ use of undeclared type or module `winit`

error[E0432]: unresolved import `surfman::platform::android`
  --> android-example/rust/src/lib.rs:17:24
   |
17 | use surfman::platform::android::tests;
   |                        ^^^^^^^ could not find `android` in `platform`

error[E0432]: unresolved import `winit`
  --> android-example/rust/src/../../../surfman/examples/threads.rs:22:5
   |
22 | use winit::{DeviceEvent, Event, EventsLoop, KeyboardInput, VirtualKeyCode};
   |     ^^^^^ use of undeclared type or module `winit`

error[E0432]: unresolved import `winit`
  --> android-example/rust/src/../../../surfman/examples/threads.rs:24:5
   |
24 | use winit::{WindowBuilder, WindowEvent};
   |     ^^^^^ use of undeclared type or module `winit`

error[E0433]: failed to resolve: use of undeclared type or module `PhysicalSize`
  --> android-example/rust/src/../../../surfman/examples/threads.rs:91:9
   |
91 |         PhysicalSize::new(window_size.width as f64, window_size.height as f64).to_logical(dpi);
   |         ^^^^^^^^^^^^ use of undeclared type or module `PhysicalSize`

warning: unused `#[macro_use]` import
 --> android-example/rust/src/lib.rs:3:1
  |
3 | #[macro_use]
  | ^^^^^^^^^^^^
  |
  = note: `#[warn(unused_imports)]` on by default

warning: unused imports: `JoinHandle`, `self`
  --> android-example/rust/src/lib.rs:16:19
   |
16 | use std::thread::{self, JoinHandle};
   |                   ^^^^  ^^^^^^^^^^

error[E0599]: no function or associated item named `current` found for struct `surfman::platform::macos::system::device::NativeDevice` in the current scope
  --> android-example/rust/src/lib.rs:42:76
   |
42 |     let device = connection.create_device_from_native_device(NativeDevice::current()).unwrap();
   |                                                                            ^^^^^^^ function or associated item not found in `surfman::platform::macos::system::device::NativeDevice`

error: aborting due to 6 previous errors; 2 warnings emitted

Some errors have detailed explanations: E0432, E0433, E0599.
For more information about an error, try `rustc --explain E0432`.
error: could not compile `surfman_android_threads`.

To learn more, run the command again with --verbose.

running on macOS 10.15.6

@nicoabie nicoabie changed the title cargo build fails on project root Cargo build fails on project root Jul 30, 2020
@jdm
Copy link
Member

jdm commented Jul 30, 2020

All the errors stem from the android example, so you can work around this by cd surfman; cargo build.

@nicoabie
Copy link
Author

Yes, but I wanted to run the android sample

@nicoabie nicoabie changed the title Cargo build fails on project root Cargo build fails on project root. Cannot run android sample. Jul 30, 2020
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants