编译C语言多线程程序的时候,如果出现 undefined reference to 'pthread_create' 错误

在编译中要加 -lpthread参数
g++ thread.c -o thread -lpthread

gcc thread.c -o thread -lpthread

特此备忘

相关文章:

猜你喜欢
  • 2022-02-16
  • 2021-12-26
  • 2021-04-10
  • 2021-08-01
  • 2021-10-25
  • 2021-09-20
相关资源
相似解决方案