Windows下Winsock2.h中函数编译时报错

undefined reference to `bind@12'|

undefined reference to `sendto@24'|

undefined reference to `recvfrom@24'|

undefined reference to `closesocket@4'|

undefined reference to `socket@12'|

undefined reference to `htons@4'|
 

CodeBlocks:

Settings->Compiler settings->linker settings,在Other linker options中添加-lwsock32

 

windows下的socket编程真垃圾,一堆错。。。。。。

 

未解决:

InetPton()函数编译不过

你可能感兴趣的:(Windows下Winsock2.h中函数编译时报错)