This is the mail archive of the gcc-help@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: shared library not found while linking C program


<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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]