3 ms·
You can statically link SDL2 itself, but you are still dynamically linking to libsystem, Cocoa and a collection of other dynamic libraries provided by the syste
by david2ndaccount 4y ago
You can statically link SDL2 itself, but you are still dynamically linking to libsystem, Cocoa and a collection of other dynamic libraries provided by the system. Same thing on Windows, you are dynamically linking to user32.dll and other libs. And why wouldn’t you anyway? The system actually offers backwards compatibility for those dynamic libraries.
Given that you already have to have a dynamically linked executable, the difference between static linking your libraries vs. just shipping dlls alongside the executable is academic. It’s just another resource the program needs to run.
Common practice on linux does make this needlessly difficult - you have to fiddle with things like RPATH so that your libraries don’t try to load from system libraries with no backwards compatibility guarantee.