Load platform native library
Beyley opened this issue · comments
Beyley Thomas commented
Is it possible to use DLLImport to call into native libraries? ex.
[DllImport("glfw")]
static extern int glfwInit();
...
glfwInit();
Upon attempting to do it this way causes an error
Unhandled Exception:
System.InvalidProgramException
at Program.<Main>$(String[] args)
trying to use
var lib = NativeLibrary.Load("libglfw.so");
just causes
Unhandled Exception:
System.DllNotFoundException: 'libglfw.so': ''
at System.Runtime.InteropServices.NativeLibrary.Load(String libraryPath)
at Program.<Main>$(String[] args)