天天看点

error: “_GNU_SOURCE“ redefined [-Werror]

解决方案

#include <sched.h>
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <stdint.h>

#define _GNU_SOURCE

           

报错

error: “_GNU_SOURCE“ redefined [-Werror]
           

如果您不想要它,#undef则将其作为编译单元的第一行。但是,您可能需要它,在这种情况下,请使用:

#ifndef _GNU_SOURCE
    #define _GNU_SOURCE
#endif
           

时间: 2021-01-16-22-08

继续阅读