How to use extern crate for FFI

Use `extern` blocks and `#[link]` attributes to call foreign functions in Rust, not `extern crate`.

You do not use extern crate for FFI in modern Rust; you use extern blocks to declare foreign functions and #[link] attributes to specify the library. Add the library to your Cargo.toml dependencies or use a system library, then declare the functions in an extern block and call them like normal Rust functions.

#[link(name = "m")]
extern "C" {
    fn sin(x: f64) -> f64;
}

fn main() {
    let result = unsafe { sin(0.0) };
    println!("Result: {}", result);
}

For C++ or other languages, ensure you link against the correct library and use the appropriate ABI (e.g., "C" for C, "C++" for C++).