1、错误日志

Linux线程编译是出现的“undefined reference to 'CPU_ZERO”

 

 

 2、解决办法

先给出解答方案:

#define _GNU_SOURCE
#include <stdio.h>
#include <sched.h>
#include <pthread.h>
#include <unistd.h>
#include <stdlib.h>

注意在makefile中加上-lphread。

注意是  #define _GNU_SOURCE ,而不是 #define _GUN_SOURCE,大写U和N顺序不能颠倒。

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2021-07-27
  • 2021-06-04
  • 2022-12-23
  • 2022-12-23
  • 2021-09-07
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-11-03
  • 2021-06-22
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案