带有冒号的-g:libevent.a的gcc库选项 [英] gcc library option with a colon, -l:libevent.a

查看:134
本文介绍了带有冒号的-g:libevent.a的gcc库选项的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在查看一个Makefile.找到了这段有趣的代码LIBS = -l:libevent.a.正在翻阅gcc文档,但未找到任何相关内容.有谁知道这意味着什么?

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?

推荐答案

它指示链接程序查找并链接名称完全为libevent.a的库, 在指定的(-Ldir)或默认链接程序搜索目录中,而不是 -lfoo指示链接程序查找并链接libfoo.so(共享库)的通常约定 或libfoo.a(静态库),如果在同一个搜索目录中都找到libfoo.so,则首选libfoo.so.

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.

请参见链接器手册中的-lnamespec | --library=namespec文档

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

这篇关于带有冒号的-g:libevent.a的gcc库选项的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆