gpt4 book ai didi

c - F_SETPIPE_SZ 未声明

转载 作者:IT王子 更新时间:2023-10-29 00:54:31 26 4
gpt4 key购买 nike

我包含了以下标题:

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <errno.h>

#include <sys/types.h>
#include <sys/stat.h>
#include <unistd.h>
#include <fcntl.h>

我也试过用

#define _GNU_SOURCE

之前#include <unistd.h> , 但它也无济于事。

我尝试使用 fcntl并通过它 F_SETPIPE_SZ作为第二个参数,但我不断收到此错误消息:

error: ‘F_SETPIPE_SZ’ undeclared (first use in this function)

其实我发现我不需要这个,但我只是好奇为什么我不能使用它。

谢谢。

所以这是解决方案,感谢 Chrono Kitsune:放

 #define _GNU_SOURCE

在任何包含之前。

最佳答案

所以这是 solution , 感谢 Chrono Kitsune :

#define _GNU_SOURCE

在任何包含之前。

你还应该关注Chrono Kitsune的其他comment .

关于c - F_SETPIPE_SZ 未声明,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25411892/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com