linux-c-programming.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Mohan Rao A. J." <mohan@netcontinuum.com>
To: "John T. Williams" <jtwilliams@vt.edu>
Cc: linux-c-programming@vger.kernel.org
Subject: Re: linking at run time.
Date: Thu, 10 Jul 2003 14:04:14 +0530 (IST)	[thread overview]
Message-ID: <Pine.LNX.4.33.0307101359270.1578-100000@mrao.netcontinuum.com> (raw)
In-Reply-To: <003501c346c8$d32cd4c0$ed64a8c0@descartes>


Hi,

You can use env variable 'LD_LIBRARY_PATH', which is
a colon-separated list of directories in  which  to
search  for ELF libraries at execution-time.

or 

if you want to make your lib directory as global to search for
libraries by the loader, add an entry in /etc/ld.so.conf and run 
ldconfig.


--
Mohan


On Thu, 10 Jul 2003, John T. Williams wrote:

> Is there a way to cause an exicutable to link against a specific library at
> run time.
> 
> let me explain a little
> I'm creating a dynamic library like this
> 
> $ gcc pop3.c -o libpop3.so -shared  -I../include
> 
> then creating an exicutable like this
> 
> $ gcc main.c -o getmail -L../lib -I../include -lpop3
> 
> both work fine.
> 
> in order to run my exicutable I have been copying my libpop3.so file to
> /use/lib
> then running ldconfig
> 
> and the file exicutes fine.  but its a bit of a pain in the butt to do this
> every time I recompile the library.
> 
> I was wondering if there was any way to run my program, getmail, so that ldd
> would link it against a specified file so that I didn't have to put a
> library that I'm developing into my /usr/lib folder.  nor have to run
> ldconfig as root.
> 
> I hope this makes sense.
> 
> 
> -
> To unsubscribe from this list: send the line "unsubscribe linux-c-programming" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> 

-- 
Mohan


  parent reply	other threads:[~2003-07-10  8:34 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-07-08 13:17 what causes SIGTERMs? Matthew Studley
2003-07-08 13:26 ` Francis Lau
2003-07-08 14:27 ` Glynn Clements
2003-07-09 15:36   ` Matthew Studley
2003-07-10  2:12     ` Glynn Clements
2003-07-10  9:50       ` linking at run time John T. Williams
2003-07-10  7:18         ` nanakos
2003-07-10  8:34         ` Mohan Rao A. J. [this message]
2003-07-11  9:51         ` Progga
2003-07-22 14:54     ` what causes SIGTERMs? Matthew Studley
2003-07-22 15:11       ` Jan-Benedict Glaw
2003-07-22 20:47         ` Glynn Clements

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=Pine.LNX.4.33.0307101359270.1578-100000@mrao.netcontinuum.com \
    --to=mohan@netcontinuum.com \
    --cc=jtwilliams@vt.edu \
    --cc=linux-c-programming@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).