Skip to content

Instantly share code, notes, and snippets.

@paulrouget
Created February 1, 2017 07:33
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save paulrouget/9ef54a1ab95401b2aba6640ea2cf9490 to your computer and use it in GitHub Desktop.
Save paulrouget/9ef54a1ab95401b2aba6640ea2cf9490 to your computer and use it in GitHub Desktop.
winit issue
[package]
name = "hello_world"
version = "0.1.0"
authors = ["Paul Rouget <me@paulrouget.com>"]
[dependencies]
# If I use winit = "*" instead, it compiles
# Using my own clone, it doesn't compile (eventhough it's the same version)
winit = {path = "../winit"} # clone of https://github.com/tomaka/winit
# Glutin depends on winit too
glutin = "*"
$ cargo build
Compiling hello_world v0.1.0 (file:///Users/paul/git/test_winit)
error: no method named `get_nsview` found for type `&winit::Window` in the current scope
--> src/main.rs:8:27
|
8 | win.as_winit_window().get_nsview();
| ^^^^^^^^^^
|
= help: items from traits can only be used if the trait is in scope; the following trait is implemented but not in scope, perhaps add a `use` for it:
= help: candidate #1: `use winit::os::macos::WindowExt;`
error: aborting due to previous error
error: Could not compile `hello_world`.
To learn more, run the command again with --verbose.
extern crate glutin;
extern crate winit;
use winit::os::macos::WindowExt;
fn main() {
let win = glutin::WindowBuilder::new().build().expect("Error");
win.as_winit_window().get_nsview();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment