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()) {
(fn_in_main_app)();
}
CLICK HERE to find out more related problems solutions.