shared library, function arguments order reversed?

kinke noone at nowhere.com
Wed May 21 10:43:17 UTC 2025


On Wednesday, 21 May 2025 at 08:09:23 UTC, xoxo wrote:
> auto fn_test = cast(void function(int, int)) dlsym(lib, "test");

This is the problem - you're casting the address to an 
`extern(D)` function pointer. Use something like this:
```
alias Fn = extern(C) void function(int, int);
auto fn_test = cast(Fn) dlsym(lib, "test");
```


More information about the Digitalmars-d-learn mailing list