简体   繁体   English

gnu-make中的-lrt标志是什么?

[英]What is the -lrt flag in gnu-make?

In a later stage of the gnu-make process gmake sent a command similar to: 在gnu-make进程的后期阶段,gmake发送了一个类似于的命令:

gcc -static foo.so.0 bar.o bizz.o buzz.o -pthreads -lrt

In that command, what dos the -lrt mean? 在那个命令中,-lrt是什么意思?

That has not related to make; 这与make无关; make will never add a flag like that on its own. make永远不会自己添加这样的旗帜。 Whomever wrote your makefile will have added that flag to the link line themselves. 谁写了你的makefile将自己的标志添加到链接行。 That is a compilation command, and -lrt is a flag passed to the compiler. 这是一个编译命令, -lrt是传递给编译器的标志。 The -l flag specifies that you should link with a library, and the name of the library follows; -l标志指定您应该与库链接,并且库的名称如下; so for -lrt it means "link with the rt library". 所以对于-lrt来说,它意味着“与rt库链接”。 This causes the linker to go look for libraries named librt.a or librt.so (for shared libraries) and link them with the output file. 这会导致链接器查找名为librt.alibrt.so库(对于共享库)并将它们与输出文件链接。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM