Linux编程日常错误

  1. 编译的时候出现如下错误提示:

undefined reference to `sem_init'
undefined reference to `sem_post'
undefined reference to `sem_wait'

编译选项需要加入一个多线程:

gcc -pthread -o outfile.out filename.c

posted @ 2019-06-17 23:54  hemeiwolong  阅读(247)  评论(0编辑  收藏  举报