Jump to content

Cara binding C++ dan Rust: Revision history

Diff selection: Mark the radio buttons of the revisions to compare and hit enter or the button at the bottom.
Legend: (cur) = difference with latest revision, (prev) = difference with preceding revision, m = minor edit.

12 March 2026

  • curprev 07:1607:16, 12 March 2026 SanzSkuy talk contribs 1,316 bytes +1,316 Created page with "Buat project rust <syntaxhighlight lang=bash> cargo new --lib rust_code </syntaxhighlight> Cargo.toml <syntaxhighlight lang=toml> [package] name = "rust_code" version = "0.1.0" edition = "2024" [dependencies] [lib] crate-type = ["staticlib"] </syntaxhighlight> lalu contoh <code>src/lib.rs</code> <syntaxhighlight lang=rust> #[unsafe(no_mangle)] pub extern "C" fn hello_from_rust() { println!("Hello from Rust"); } #[unsafe(no_mangle)] pub extern "C" fn add_number(a..."