parsed.org
Specifying Runtime Linkage Paths by cygnus on Dec 31, 2005 03:51 PM

You can specify the search path(s) used by ld at runtime to find shared objects by building your program with the -rpath option:

$ gcc -Xlinker -rpath -Xlinker /path/to/my/libraries filename.c

This is the equivalent of:

$ ld -rpath /path/to/my/libraries filename.o
ccommandscompilationgcclanguagesldlinkingprogramming
RSS