Call external function in dylib

Dylibs can’t depend on the application that loads them. The dylib dependency graph must be entirely linear, circular depedencies are not allowed. Depending on what you’re doing it may be possible to move fn_in_main_app to an upstream dependency of the dylib. You could also pass in a function pointer to the dylib:

pub extern "Rust" fn fn_in_dylib(fn_in_main_app: fn()) {

CLICK HERE to find out more related problems solutions.

Leave a Comment

Your email address will not be published.

Scroll to Top