gpt4 book ai didi

c++ - linux中的套接字头在哪里

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

我用 #include <sys/socket.h> 编译我的简单程序但是没有这个文件。它在哪里,我刚开始在 linux 中编码,我不知道它在哪里。还是需要在线下载。

最佳答案

如果您安装了手册页,第一站应该是 man socket

没有手册页你可以调用

find /usr/include -name socket.h

哪些输出

/usr/include/asm/socket.h
/usr/include/sys/socket.h
/usr/include/bits/socket.h
/usr/include/linux/socket.h

在我的系统上,要包含的是 sys/socket.h

另见 Single UNIX Specification .

关于c++ - linux中的套接字头在哪里,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4023343/

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