diff --git a/rust-hdl-ok-frontpanel-sys/build.rs b/rust-hdl-ok-frontpanel-sys/build.rs index 4151ef2a..0d95356a 100644 --- a/rust-hdl-ok-frontpanel-sys/build.rs +++ b/rust-hdl-ok-frontpanel-sys/build.rs @@ -3,18 +3,19 @@ extern crate bindgen; use std::path::PathBuf; fn main() { - println!("cargo:rustc-link-lib=dylib=okFrontPanel"); let root_path = PathBuf::from(std::env::var("OK_FRONTPANEL_DIR").expect( "Set OK_FRONTPANEL_DIR to absolute path of the FrontPanel/API directory on this system", )); println!("cargo:rustc-link-lib=dylib=okFrontPanel"); + + let lib_path = root_path.join("lib").join("x64"); println!( "cargo:rustc-link-search=native={}", - root_path.to_str().unwrap() + lib_path.to_str().unwrap() ); let bindings = bindgen::Builder::default() - .header(root_path.join("okFrontPanel.h").to_str().unwrap()) + .header(root_path.join("include").join("okFrontPanel.h").to_str().unwrap()) .generate() .expect("Unable to generate bindings"); @@ -22,4 +23,4 @@ fn main() { bindings .write_to_file(out_path.join("bindings.rs")) .expect("Couldn't write bindings!"); -} +} \ No newline at end of file diff --git a/rust-hdl-ok-frontpanel-sys/src/lib.rs b/rust-hdl-ok-frontpanel-sys/src/lib.rs index f9777d2a..afd39de9 100644 --- a/rust-hdl-ok-frontpanel-sys/src/lib.rs +++ b/rust-hdl-ok-frontpanel-sys/src/lib.rs @@ -126,7 +126,7 @@ impl OkHandle { } pub fn set_wire_in(&self, addr: i32, val: u16) { - unsafe { okFrontPanel_SetWireInValue(self.hnd, addr, val as u64, 0xFFFF) }; + unsafe { okFrontPanel_SetWireInValue(self.hnd, addr, val as u32, 0xFFFF) }; } pub fn update_wire_ins(&self) {