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

 

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

相关文章:

猜你喜欢
  • 2022-01-03
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案