This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Re: shared library not found while linking C program
- From: prj at po dot cwru dot edu (Paul Jarc)
- To: <pinafl at freesurf dot fr>
- Cc: <gcc-help at gcc dot gnu dot org>
- Date: Fri, 16 Aug 2002 11:51:08 -0400
- Subject: Re: shared library not found while linking C program
- Organization: What did you have in mind? A short, blunt, human pyramid?
- References: <57870.194.2.91.222.1029512777.squirrel@arlette.freesurf.fr>
<pinafl@freesurf.fr> wrote:
> GCC is called with the -L option for additionnal directory to search in.
> I'd like to use the -l option to name the right library but it is not
> recognised, GCC is then looking for a "-llibname" file and of course does
> not find it.
gcc ... /path/to/libfoo.so
is equivalent to:
gcc ... -L/path/to -lfoo.so
So use the first form if your library is not named lib*. You'll
probably also want to add /path/to to $LD_RUN_PATH at compile time or
$LD_LIBRARY_PATH at run time, if the library isn't in one of the
system library directories.
paul