(Draft; this ended up working for a big Qt5 app, but not a simple test exe for whatever reason, so beware)
When creating a stand alone application on windows, the problem of bundling dynamically linked libraries arises, because by default, the linker only checks a system wide path and the folder containing the executable. Most people don't concern themselves with this too much and just dump all their dlls into the folder together with the exe, but this makes for a really miserable user experience, especially when the number of dlls is more than a handful.
Ideally, we want to stash all libraries into a subdirectoy, everything else (assets etc.) into separate subdirectories, and only leave the executable at the top.
On Linux, this would be very easy to achieve: we could just pass -rpath=$ORIGIN/lib
to ld, and the dynamic linker would always check the "lib" folder relative to the executable when resolving .so's. In fact, this mechanism is the bread-and-butter of independently distributed proprietary games o