RE: Problem with gcc linker

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

 



Thanks for the information, Dr. Kirby.
Is that -R flag for the compiler or the linker?
I thought the linker's -L flag will tell it to look for libraries there.  I
guess it does not embed the path in the final library file.

> 
> 
> The issue is that the run time linker does not know to look in
/usr/local/lib for
> libraries, so unless the path is hard-coded into the executable, the
libraries
> will not be found.
> 
> Some programs are compiled in such a way they automatically look in
> /usr/local/lib. You should find that by recompiling all your sources with
the
> compiler flag "-R /usr/local/lib" will work.
> 
> Setting
> 
> LD_LIBRARY_PATH=/usr/local/lib
> export LD_LIBRARY_PATH
> 
> will probably "solve" your problem, in that your code will probably find
the
> libraries. But it's not a very good solution.
> 
> You can change the places the run time linker looks for libraries. You
could
> make it always look in /usr/local/lib, but such a change is a bad idea
IMHO.
> 
> Dave



[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux