Closed ibx34 closed 1 year ago
Your function definition has no specified calling convention (which defaults to extern "Rust"
) while the loaded function specifies extern "C"
. This is most likely what's going wrong here. Some of https://doc.rust-lang.org/nomicon/ffi.html is probably quite useful to read through, as libloading
is pretty much that, just that it happens at the runtime.
I’ll close for now as answered but feel free to ask further questions.
I'm currently trying to make a plugin system for a project of mine and hit a road block. Loading the desired library works, and getting the function inside it works. However, when I try to call the function while passing in a database (
pub struct Database(pub Pool<Postgres>)
it fails.Here is the function im trying to run:
and here is what is invoking it: