makefile错误:syssocket.h在Windows下没有这样的文件或目录

makefile错误:syssocket.h在Windows下没有这样的文件或目录,第1张

概述我在下面使用以下makefile: CC=g++all: socket.exesocket.exe: socket.o g++ socket.o -o socket.exesocket.o: socket.cpp g++ -c socket.cpp 当我运行make it show error: socket.cpp: sys/socket.h: no such fil 我在下面使用以下makefile:

CC=g++all: socket.exesocket.exe: socket.o    g++ socket.o -o socket.exesocket.o: socket.cpp    g++ -c socket.cpp

当我运行make it show error:

socket.cpp: sys/socket.h: no such file or directory.

怎么解决?我在windows上工作.

解决方法 < SYS / socket.h中>适用于UNIX / linux.

对于windows,使用< Winsock2.h>.您还需要链接Ws2_32.lib并调用WSAStartup以使用WinSock.

也可以看看:

> socket function(MSDN)
> Windows Socket Programming in C(堆栈溢出)

总结

以上是内存溢出为你收集整理的makefile错误:sys / socket.h在Windows下没有这样的文件目录全部内容,希望文章能够帮你解决makefile错误:sys / socket.h在Windows下没有这样的文件或目录所遇到的程序开发问题。

如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。

欢迎分享,转载请注明来源:内存溢出

原文地址:https://54852.com/langs/1215880.html

(0)
打赏 微信扫一扫微信扫一扫 支付宝扫一扫支付宝扫一扫
上一篇 2022-06-05
下一篇2022-06-05

发表评论

登录后才能评论

评论列表(0条)

    保存