Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Linux #7

Open
jpbruyere opened this issue Jan 17, 2019 · 2 comments
Open

Linux #7

jpbruyere opened this issue Jan 17, 2019 · 2 comments

Comments

@jpbruyere
Copy link

I've tested SharpVK on linux, to have it working (debian 10):

  1. change 'glfw3' to 'glfw' for library name, under debian, lib has the version suffixes out of the scope of dll import.
  2. use 'Path.Combine' to build shader pathes (directory backslash is for win only).

After these two simple steps, HelloTriangle works.

@FacticiusVir
Copy link
Owner

So this falls into one of the gaps in .NET Core's handling of P/Invoke. In early versions (targetting Mono & .NET Fx) the difference in library names was handled by DllMap entries in the executable config; that is no longer possible in Core, so I'm not 100% sure how to fix it.

  • I could switch the library name to "glfw" and rename all the DLLs in the examples, but that seems hacky and likely to break existing Windows code.
  • I could remove direct P/Invoke and use some kind of NativeLibrary shim to load per-platform, but that would be a decent chunk of work and a breaking change to the API.
  • There is DllMap support coming in .NET Core, possibly as soon as 3.0, but that's an uncertain wait.

@jpbruyere
Copy link
Author

The best option would be a dll map like mechanic. On linux, it's possible to create a symbolic link to target glfw3 name. That's maybe the best alternative for now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants