This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Re: -Ldir search order
"Duran, Richard" <RDuran@dallasairmotive.com> writes:
> The documentation states that directories identified with "-Idir"
> are to be searched before system include directories. Are
> directories identifed with "-Ldir" searched before system lib
> directories? The documentation makes no statement either way.
Yes, directories specified with -L are searched before system library
directories.
The compiler handles the -I option directly. The -L option is simply
passed to the linker, which is not part of the compiler. So in
principle the behaviour of the -L option is determined by the linker.
In practice all linkers search -L directories before system
directories.
Ian