rust-from-c-example icon indicating copy to clipboard operation
rust-from-c-example copied to clipboard

Example of linking to and calling Rust code from C

This is an example of creating a shared library implemented in Rust that can be linked and called from C.

Tested with Rust master branch, commit 4da1cfe92369725b2e6bf34acb1fdebdbaff9339.

Blog post: http://bluishcoder.co.nz/2013/08/08/linking_and_calling_rust_functions_from_c.html

Discussion: http://www.reddit.com/r/rust/comments/1jvqvf/an_minimal_example_of_calling_into_a_rust_lib/