Netinet and netdb not found, c++ network libraries

南笙酒味 提交于 2020-06-17 09:57:07

问题


I was trying to run example codes to learn how to use winsock on c++ from the following links: http://www.linuxhowtos.org/data/6/client.c http://www.linuxhowtos.org/data/6/server.c

and the following libraries:

#include <sys/socket.h>
#include <netinet/in.h>
#include <netdb.h> 

was not at the default mingw libraries, and by trying to google it wasn't much of a success because it end up requiring other libraries to run.

if anyone have a link to the full library or it with the dependencies, i would appreciate it.

Thanks in advance.


回答1:


I removed both netinet/in.h and netdb.h library, added and added the link: "-lwsock32", all working now.



来源:https://stackoverflow.com/questions/15561169/netinet-and-netdb-not-found-c-network-libraries

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!