2 ms·
> which I actually find a bit annoying for deploying applications to users Linux ELF binaries can have a library search path embedded using the -rpath linker o
by account42 6y ago
> which I actually find a bit annoying for deploying applications to users
Linux ELF binaries can have a library search path embedded using the -rpath linker option. Inside that search path, '$ORIGIN' refers to the binary location so you can have the Windows behavior if you want to.
- quietbritishjim 6y agoAmazing, thanks! I already knew about the embedded -rpath but hadn't heard about $ORIGIN before so I always dismissed it as not being much use. According to this StackOverflow answer [1] you need to use the -z origin switch but I only found that thanks to you pointing me in the right direction. I'll be adding this particular gotcha to my deployed executables immediately! [1] https://stackoverflow.com/questions/6324131/rpath-origin-not-having-desired-effect https://stackoverflow.com/questions/6324131/rpath-origin-not...