nagisa / rust_libloading

Bindings around the platform's dynamic library loading primitives with greatly improved memory safety.
https://docs.rs/libloading
ISC License
1.24k stars 102 forks source link

How to add a dll search folder ? #128

Closed makao007 closed 1 year ago

makao007 commented 1 year ago

I want to put all the dll files into a folder called "mydll", and one of the dll dependence on other dll . The below code go wrong because the a.dll depend on mydll/b.dll Library::new("mydll/a.dll").unwrap(); how to fixed this ?

nagisa commented 1 year ago

Consider one of the load path altering flags and passing them to libloading::os::windows::Library::load_with_flags. The flags are further documented here.

nagisa commented 1 year ago

That said, this is a place for issues in libloading, rather than a support forum. A better place for questions like these would be stack overflow or https://users.rust-lang.org/. With that in mind I will close this issue for now. Thank you for considering this library :)