-Ldir search order
Ian Lance Taylor
ian@wasabisystems.com
Mon May 17 15:56:00 GMT 2004
"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
More information about the Gcc-help
mailing list