Skip to content

Instantly share code, notes, and snippets.

@mrwilson
Created May 25, 2015 20:42
Show Gist options
  • Save mrwilson/bba1da6afaf6f7deed54 to your computer and use it in GitHub Desktop.
Save mrwilson/bba1da6afaf6f7deed54 to your computer and use it in GitHub Desktop.
Rust extern functions.
#[link(name = "sqlite3", kind="static")]
extern {
fn sqlite3_libversion_number() -> i8;
}
fn main() {
let x = unsafe { sqlite3_libversion_number() };
println!("Sqlite3 lib version number is {}!", x); // 2!
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment