Hi there,
I create a C Project in Eclipse Photon Milestone 6 (4.8.0M6).
Create one rust file test.rs having code below -
#![crate_type = "staticlib"]
#[no_mangle]
pub extern "C" fn get_number() -> isize {
42 as isize
}
Create the object file for the same from below command
rustc test.rs --emit=object
Create a C file having main function as below
#include<stdio.h>
#include<conio.h>
#include<stdint.h>
int32_t get_number();
int main() {
printf("Welcome to the C World !!!");
int result = get_number();
printf("number is %d",result);
return 0;
}
Now i want to call the get_number() function from C file.
How can i do that ????????????
Sorry, you need to Log In to post a reply to this thread.