compiling and linking

Hello,

is there any good information about linking libraries that clarifies the
difference and usage of “shared” and “static” linking of libraries? I read
that by chosing -static or -Bstatic in the compiler options (qcc) I could
bound a library directly to my own executable and thus avoid the process
manager looking up a possibly wrong or old library present on an other
machine (I transferred my executable there by ftp). But on the other machine
running is not possible, because the library is still required there to look
up something…

How can I bound a library to my executable so that the executable is
certainly independent?

Thanks.

Nnamdi