[Tutor] Set LD_LIBRARY_PATH and equivalents platform-independently

Alan Gauld alan.gauld at btinternet.com
Sat Jan 19 15:39:07 CET 2013


On 19/01/13 12:24, Albert-Jan Roskam wrote:

> Thank you! I am getting a whole lot wiser wrt Linux. I checked 'man ld' and 'man ldconfig'.
> Especially the ld command is pretty extensive. The Rpath/Runpath solution seems nice in that
> no wrapper is needed (contrary to when one uses LD_LIBRARY_PATH). But is Windows the only
> exception in the way that libraries are dealt with? Or do DLLs also have a dynamic area?

Every OS is different in how it builds executables and links to 
libraries. DOS is different to Windows and Unix. VMS is different again. 
IBM OS/390 is different again. And other OS like Vxworks, and OS/9 are 
similar to *nix but not quite the same. You are really
in the depths of OS internals and need to research every platform on its 
own merits.

The good news is that all unix variants (including Solaris,
BSD, Darwin(MacOS) and linux work very similarly) And Windows is the 
only mainstream exception, at least on the desktop. So unless you are 
writing server software its not too bad.

-- 
Alan G
Author of the Learn to Program web site
http://www.alan-g.me.uk/



More information about the Tutor mailing list