Since none of the similar topics managed to get any answer and all related topics have disabled answers I decided to share it what was my solution for that problem.
#[no_mangle]
pub extern "C" fn look_at_me2() -> usize {
42
}
fn main(){
println!("Hello");
}
The following code can be compiled with export-executable-symbol flag (docs export_executable_symbols - The Rust Unstable Book ). This flag was available only with nightly version.
To bump to rust nightly, you can run:
rustup default nightly
To use export-executable-symbol you can run:
cargo rustc --bin engine -- -Z export-executable-symbols
If there is any other way to accomplish that without installing nightly version, feel free to join discussion!
2 Likes
Please use text for the code so that everyone (including those using screen readers) can read it.
To format code in this forum you need to surround the code with three backticks (```). For example, typing this...
```
fn main() {
println!()
}
```
...will be rendered as highlighted Rust code, like so:
fn main() {
println!()
}
You can also tell the forum software which language you're using by adding the language after the opening backticks.
```cpp
#include <iostream>
int main() {
std::cout << "Hello World!";
}
```
Will appear with highlighting as:
#include <iostream>
int main(…
Thanks, edited and fixed.
1 Like
system
Closed
September 18, 2024, 4:02pm
4
This topic was automatically closed 90 days after the last reply. We invite you to open a new topic if you have further questions or comments.