Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

gcc library option with a colon, -l:libevent.a

I'm going through a Makefile. Found this interesting bit of code, LIBS = -l:libevent.a. Was digging through gcc documentation but didn't find anything relevant. Does anyone know what it means?

like image 603
flashburn Avatar asked Jan 31 '18 00:01

flashburn


1 Answers

It instructs the linker to find and link a library with the exact name libevent.a, in the specified (-Ldir) or default linker search directories, as opposed to the usual convention whereby -lfoo instructs the linker to find and link either libfoo.so (shared library) or libfoo.a (static library), preferring libfoo.so if both are found in the same search directory.

See the documentation of -lnamespec | --library=namespec in the linker manual

like image 113
Mike Kinghan Avatar answered Nov 04 '22 01:11

Mike Kinghan