sciter-sdk / rust-sciter

Rust bindings for Sciter
https://sciter.com
MIT License
804 stars 76 forks source link

failing to build on mac #6

Closed zakrn closed 8 years ago

zakrn commented 8 years ago

trying to run the example in step 3 gives me this error on mac, any ideas?

cargo run --example minimal Compiling sciter-rs v0.4.0 src/window.rs:82:33: 82:37 error: mismatched types: expected platform::windows::OsWindow, found *mut capi::sctypes::_HWINDOW (expected struct platform::windows::OsWindow, found *-ptr) [E0308] src/window.rs:82 Window { base: OsWindow::from(hwnd), host: Rc::new(Host::attach(hwnd)) } ^~~~ src/window.rs:82:33: 82:37 help: run rustc --explain E0308 to see a detailed explanation error: aborting due to previous error Could not compile sciter-rs.

get200 commented 8 years ago

when you build it on mac or linux,the struct OsWindow do not have a method named "from".so you can not built it on mac. you can fix it like this:

/// Attach Sciter to existing native window.
 pub fn attach(hwnd: HWINDOW) -> Window {
        #![cfg(windows)]
        assert!( hwnd.is_null() == false );
        Window { base: OsWindow::from(hwnd), host: Rc::new(Host::attach(hwnd)) }
    }
pravic commented 8 years ago

Thanks for reporting this. Try now.