DLL or SO C/C++ libraries


#1

How can i write FFI interface to kernel32.dll on windows and are there any similar examples for macOS and linux to link a dynamic library in rust ?


#2

It would probably look something like this.


#3

If you are looking for a way to load dynamic libraries yourself I would recommend looking at https://github.com/nagisa/rust_libloading/

I have also built my own create around this called “dynamic reload” https://github.com/emoon/dynamic_reload that allows you to “hot swap” shared objects without leaving the main application but that might not be what you need.