7.3.3.2 Libraries

  • -Wl,-llibrary

    Search the library named library when linking.

    It makes a difference where in the command you write this option. The linker searches and processes libraries and object files in the specified order. Thus, foo.o -lz bar.o searches library z after file foo.o but before the bar.o.

    The linker searches a standard list of directories for the library, a file named liblibrary.a. The linker then uses this file as if it had been specified precisely by name.

  • -Wl, Ldir

    Add directory dir to the list of directories to be searched for -l.