Boston Linux & Unix (BLU) Home | Calendar | Mail Lists | List Archives | Desktop SIG | Hardware Hacking SIG
Wiki | Flickr | PicasaWeb | Video | Maps & Directions | Installfests | Keysignings
Linux Cafe | Meeting Notes | Blog | Linux Links | Bling | About BLU

BLU Discuss list archive


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

linking



I'm sure this is pretty basic, but I'm having a hard time tracking this
info down.

Let's say I have both a shared and a static version of the same library
- libalib.a and libalib.so.  If they both reside in the same directory,
which one will get linked?

Say for the sake of argument that shared libraries are linked first.
Then if several directories are being searched (-L<dir1> -L<dir2>) will
the library search order be:

(a) dir1/shared dir2/shared dir1/static dir2/static
or
(b) dir1/shared dir1/static dir2/shared dir2/static

The article on using shared libaries at

http://www.linux-mag.com/2002-04/compile_01.html

seems to indicate that dlfcn.h/-ldl is used to incorportate shared
library functions into a program.  Does this imply that my previous two
questions are nonsensical?  I.E. - a program is written to either use
shared or static libraries, but not both?

-- 
Ron Peterson                   -o)
87 Taylor Street               /\\
Granby, MA  01033             _\_v
https://www.yellowbank.com/   ---- 




BLU is a member of BostonUserGroups
BLU is a member of BostonUserGroups
We also thank MIT for the use of their facilities.

Valid HTML 4.01! Valid CSS!



Boston Linux & Unix / webmaster@blu.org