Loading Shared Libraries on Linux

About three years ago, I wrote a post about wrangling dynamic libraries for Mac applications. I recently faced the same challenge on Linux, so I figured I’d write a follow up.

If you’re new to dealing with dynamic libraries, I’d recommend reviewing the previous post first - it covers some fundamentals that I won’t rehash here. Linux and Mac handle dynamic libraries in similar ways - but as you might guess, the tools used and some details vary.

[Read More]

Loading Dynamic Libraries on Mac

G-Engine uses various third-party libraries: ffmpeg for video playback, fmod for audio playback, zlib for decompression, etc. In all these cases, the library is included as a “dynamic library” (as opposed to a “static library”).

On Windows, when an executable needs a dynamic library, it searches for it in a few predefined locations, such as “the same directory as the executable”. On Mac and Linux, however, the situation is different and requires some consideration and explanation.

I was recently learning how macOS loads dynamic libraries, and it is not as intuitive or well documented as you might hope. This post attempts to lay things out in a clear and easy to digest way.

[Read More]