gcc - gcc -lnsl 这个标志有什么作用?
问题描述
对不起,noobie 问题,但我无法理解这个.. gcc -lnsl 标志是做什么的。我尝试通过互联网搜索也阅读了有关 rpc 的信息。
解决方案
该标志告诉 gcc 将二进制文件与nsl
库链接。更清楚地说,该行gcc -lnsl
可以重写为更详细的等价物gcc -l nsl
。见man gcc:
-llibrary -l library Search the library named library when linking. (The second alternative with the library as a separate argument is only for POSIX compliance and is not recommended.) The -l option is passed directly to the linker by GCC. Refer to your linker documentation for exact details. The general description below applies to the GNU linker. The linker searches a standard list of directories for the library. The directories searched include several standard system directories plus any that you specify with -L.
推荐阅读
- database - 以下分解是否无损且依赖关系保持不变?
- reactjs - 如何在 REACT useEffect 函数中从 webservice 获取数据并将其发送到 props 对象?
- javascript - JS 中的 Importing(require) 模块是否也执行整个代码?
- c - 我需要一个替换 func1,2,3,4,5 的函数
- html - notepad++ 有没有办法连接一个使用外部 style.css 文件的方法。?
- arrays - 在Java中向某个数组索引添加数量
- c++ - 使用 BOOST_STRONG_TYPEDEF 区分 arg 类型但导致 seg 错误
- amazon-web-services - aws bottlerocketOS 容器运行时
- sql - 为什么 Column Viti 为空?
- batch-file - 如何在当前 PC 时间上增加几秒?