-
Notifications
You must be signed in to change notification settings - Fork 183
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
fix: link the SDL library statically #2068
Conversation
This allows to run the executable on windows using: .build/bin/sdl_example Previously it would give an error message that "SDL.dll" was not found.
I tested on Windows natively (in a |
This looks fine, but it did work when using pixi run right? |
Yes, the Also this PR needs to be tested on macOS, the static linking might not work there. |
Thanks @certik, assigned our Mac users to test it, if they approve we can merge it! |
Although its nice to run it without |
Is there a way on Windows to make the program just work by finding the "dll" libraries automatically? Or is static linking the only option? On Linux and macOS you can use rpath that seems to work pretty well, alleviating most issues with shared libraries. |
I dont think there is something like rpath, but if the dlls are next to the executable that would work. |
Is this ready to merge? |
I've been using SDL in a project for some time with pixi, and I had problems with static linking on all platforms. I personally think static linking is preferable for end user applications, especially on Windows where the habit seems to be to simply pack all dlls and ship them with the application. So the dlls are not reused anyway, so might as well just link it statically. However, given the linking problems I had, I would recommend to stick with dynamic linking for now, since this is a demo and must work on all platforms out of the box. So I am going to close the PR. |
This allows to run the executable on windows using:
Previously it would give an error message that "SDL.dll" was not found.