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

北城以北 提交于 2019-12-10 17:34:03

问题


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?


回答1:


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



来源:https://stackoverflow.com/questions/48532868/gcc-library-option-with-a-colon-llibevent-a

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!