gcc -lnsl这个标志有什么作用?

时间:2019-08-29 11:02:57

标签: gcc rpc

很抱歉出现noobie问题,但我无法理解这一点.. gcc -lnsl标志做什么。 我尝试通过Internet搜索还了解了rpc。

1 个答案:

答案 0 :(得分:0)

此标志告诉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.