-
Notifications
You must be signed in to change notification settings - Fork 13.6k
Closed
Description
Note: looks very similar to #33842, but I'm opening a new issue since that is closed and old.
Basically I'm having the same issue here. This is my project which has 3 crates: one static lib, one dynamic lib (cdylib) and an executable.
The dynamic lib (ecs_game) depends on the static lib (ecs_engine) and gets compiled into a single DLL. The executable (ecs_runner) then loads the DLL dynamically (I'm using the libloading
crate for that).
Here is what happens:
- on Linux/Mac, the lib gets loaded just fine
- on an old (pre-anniversary update) Windows, it gets loaded just fine
- on newer Windows installations, it fails with error 126.
I also tried to create a small C program that uses LoadLibraryA
directly to load the library and it gives the same exact error.
Am I doing something wrong here?
(this is the C loader:)
#include <windows.h>
#include <stdio.h>
int main() {
HMODULE lib = LoadLibraryA("ecsde/target/release/ecs_game.dll");
if (lib) {
printf("Hurray!\n");
} else {
DWORD last_err = GetLastError();
printf("Failed to load. Last err = %d\n", last_err);
}
}
Note that if I link the DLL at link-time, it works fine. It's just dynamic loading that gives problems.
Metadata
Metadata
Assignees
Labels
No labels