Foreign function interface


#1

when i tyep the base example in the document like this:

extern crate libc;
use libc::size_t;
#[link(name = "snappy")]
extern {
    fn snappy_max_compressed_length(source_length: size_t) -> size_t;
}

fn main() {
    let x = unsafe { snappy_max_compressed_length(100) };
    println!("max compressed length of a 100 byte buffer: {}", x);
}

I try to compile it with cargo build ,but something was wrong.
the compiler told me that :error linking with ‘cc’ failed:exit code :1 , note /usr/bin/ld: cannot find -lextlib.
who can tell me why.
thank you very much!