-
Notifications
You must be signed in to change notification settings - Fork 116
Closed
Labels
Description
Currently, as per the docs, on Windows, the default behavior for Library::open(…) is to automatically concatenate the platform-specific .dll extension when no extension is provided (or just omit it when a . suffix is given.)
This behavior is inconsistent across platforms, for example:
use libloading::Library;
fn main() {
let library = Library::new("libzeta_core").unwrap();
}On Windows, this will, as expected, try to load libzeta_core.dll - however, on Linux, this will try to load libzeta_core which is not the expected shared library filename - it's expected to be libzeta_core.so.
I'd suggest that libloading provides a platform-specific load sequence:
- If no extension is given, it should try to load the library with a platform-specific extension
-
- On Linux, *BSD and macOS, this should be
.so
- On Linux, *BSD and macOS, this should be
-
- On Windows, this should be
.dll
- On Windows, this should be
In all cases, when a . suffix is given, it should just try to load the filename without any extension.