Skip to content
This repository has been archived by the owner on Mar 28, 2024. It is now read-only.

Load platform native library #52

Open
Beyley opened this issue Jan 24, 2023 · 0 comments
Open

Load platform native library #52

Beyley opened this issue Jan 24, 2023 · 0 comments

Comments

@Beyley
Copy link

Beyley commented Jan 24, 2023

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)
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant