[百度空间] ld: add library file reference by path & file name

By default, -l option will search libraries with lib* prefix in speficied search paths.

i.e.

1
ld -o a.out -lA cppmain.o

will search libA.so/libA.a in all library search paths.

 

but it is possbile to set library by using a path & any filename(without lib prefix): use -l:"PATH_TO_LIBFILE"

1
ld -o a.out -l:~ /dynlib .foo

你可能感兴趣的:(reference)