根据APUE写线程代码阿,出现如下错误:

1 test_pthread_create.c:(.text+0x2e6): undefined reference to `pthread_create'

原因是没有链接libthread.a库文件,所以编译方法是:

1 $ gcc -lpthread test_pthread_create.c 



相关文章:

  • 2022-01-17
  • 2022-03-10
  • 2021-11-07
  • 2021-05-31
  • 2021-06-08
  • 2021-05-26
  • 2021-09-30
猜你喜欢
  • 2021-11-18
相关资源
相似解决方案