This example is similar to the traditional plugin. But we are calling a Rust function to log a message.
- test.c:
void alertMethod(WrenVM* vm) {
// ...
core->log(ctx, "%s\n", rust_function());
// ...
}
Is important to include the generated static lib in the compilation step. libexample.a
test.dylib: test.c
gcc -dynamiclib -o test.dylib -I../../include test.c libexample.a -undefined dynamic_lookup