-
Notifications
You must be signed in to change notification settings - Fork 49
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
Default Native Library Name #8
Comments
Cant we add and dll.config like https://github.com/opentk/opentk/blob/master/src/OpenTK/OpenTK.dll.config? We can configure the new .csproj files to automatically copy this file the output directory. |
AFAIK, the DLL map is framework dependent, and the way that Mono handles resolving native libraries. .NET Core uses Changing the library name in this library will have no real effect, as the above mentioned methods will still need to be implemented if your application targets multiple frameworks and platforms. By changing the default name to drop the version suffix, it will allow Unix platforms to need no extra resolving. A Windows user will likely need to resolve the path regardless, as their are multiple binaries for x86 and x64. By changing the name, it is basically a win-win. Nothing really changes on Windows platforms, worse-case scenario they need to edit the library name, and it will allow it to be found automatically on Unix platforms without need for resolving. As stated above, the actual technique for resolving the library is going to be dependent on the application that uses it, and goes beyond the scope of any .NET Standard library. .NET Framework, .NET Core, and Mono all handle this differently. The name change will simply limit the number of scenarios where automatic resolving fails it need to go to a fallback in user-code, whatever way that will be. EDIT: |
Closing this for now. |
@ForeverZer0 open this again for .Net Core now that 3.1 is out? |
Good call, will do. Work on this has been agonizingly slow, just life happening, but will be done in the foreseeable future. |
The library name use with the
DllImportAttribute
to import the functions at run-time currently uses the Windows default naming convention ofglfw3
, as opposed to its Unix-like counterpart:glfw
.This causes anyone using the library on Linux/Mac to have to manually edit the library name and recompile, since they have no control over the name of native GLFW library as it gets installed on the system.
Since Windows users need only include the pre-built and portable binaries with their application, refactoring the native library name to
glfw
is trivial, and will not require editing the code or rebuilding, only the library name which they must provide themselves anyway.Proposal is to change the constant to the
Glfw.LIBRARY
constant fromglfw3
toglfw
, so Unix users need only include the library and run it, and Windows users only need to apply a rename to the binaries while adding them to their project.This should hopefully reduce hassle for everyone on all platforms, and enforce a standardized name "that just works" without all the extra mumbo-jumbo of resolving dependencies at runtime. Windows users will still need to account for CPU architecture and which binary to target, but that is unavoidable.
The text was updated successfully, but these errors were encountered: