Created
March 13, 2020 15:08
-
-
Save Wazzaps/b8b28c7123820874c5455bf5a07ef979 to your computer and use it in GitHub Desktop.
ab wants to call ba::hello(). ab should be the one dynamically loaded here, but it shouldn't matter I think.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
mod ba { | |
#[link(name="ba")] | |
extern "Rust" { | |
#[link_name = "_ZN2ba5hello17hb8c57573de8c5a19E"] | |
pub fn hello(); | |
} | |
} | |
fn main() { | |
unsafe { ba::hello() } | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
pub extern fn hello() { | |
println!("hello"); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment