C++ C4996: 'inet_addr': Use inet_pton() or InetPton() instead or define _WINSOCK_DEPRECATED_NO_WARNINGS

错误:C4996: 'inet_addr': Use inet_pton() or InetPton() instead or define _WINSOCK_DEPRECATED_NO_WARNINGS to disable deprecated API warnings

在vs2017 下socket编程时会出现如题的错误,错误的原因在于从VS2013版本以上开始支持新的函数,使用旧的函数会报错。

这里推荐使用新的函数替换老的函数。

解决方法:

1.可以修改VS配置,使其支持老的函数

把SDL检查关闭

 

 

参考:https://blog.csdn.net/qq_22642239/article/details/102456232

 

posted @ 2022-05-07 16:34  剑存古风  阅读(410)  评论(0编辑  收藏  举报