public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
* LIBRARY_PATH priority - Reg
@ 2024-01-09  9:13 Lakshmi Narayana Velayudam
  0 siblings, 0 replies; only message in thread
From: Lakshmi Narayana Velayudam @ 2024-01-09  9:13 UTC (permalink / raw)
  To: gcc-help

[-- Attachment #1: Type: text/plain, Size: 972 bytes --]

Dear GCC Team,
While trying to compile a project which depends on some shared libraries I
used LIBRARY_PATH variable to make sure they are searched in the right
directories during compile time. I noticed that gcc is searching for the
path in LIRBARY_PATH first but in the below way
Example:
export LIBRARY_PATH=/home/narayana/dependencies/
-> gcc is checking for /home/narayana/dependencies/../lib first then some
standard directories and then the actual path in LIBRARY_PATH
i.e.,/home/narayana/dependencies/ and then some more directories.

Due to this my project is getting compiled with libraries in standard
libraries. Is there a way to prevent this except the usage of -L flag and
also why does gcc assumes that the path I mentioned in LIBRARY_PATH has lib
folder... Should I create a lib folder then will it work on all
distributions?

I tried with gcc 4.8.5 Cent OS and gcc-9 on Ubuntu 22.2. Kindly let me know
if you need more details on this.

Regards,
Narayana

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2024-01-09  9:14 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-01-09  9:13 LIBRARY_PATH priority - Reg Lakshmi Narayana Velayudam

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 read-only IMAP folder(s) and NNTP newsgroup(s).