October 2019
Intermediate to advanced
444 pages
10h 37m
English
Let's create some bindings in just a few steps:
[build-dependencies]bindgen = "0.49"
use std::env;use std::env::var;use std::path::PathBuf;const HEADER_FILE_NAME: &'static str = "../tinyexpr/tinyexpr.h";fn main() { let project_dir = var("CARGO_MANIFEST_DIR").unwrap(); println!("cargo:rustc-link-search={}/../tinyexpr/", project_dir); println!("cargo:rustc-link-lib=static=tinyexpr"); if cfg!(target_env = "msvc") { println!("cargo:rustc-link- lib=static=legacy_stdio_definitions"); } let bindings = bindgen::Builder::default() .header(HEADER_FILE_NAME) ...Read now
Unlock full access