-lrt

在编写pthread有关的程序时,编译时老是报"undefined reference to `pthread_create'"的错误,
原因是没有链接pthread相关的库,gcc加上-lrt就可以了.
我想怎样默认去链接这个库了?不要再加个"-lrt"了
也就是"/usr/lib/"下的libpthread.a,
应该在哪个配置文件中进行配置了?

warning: the `gets' function is dangerous and should not be used.;

原文地址:https://www.cnblogs.com/ruiy/p/pth.html