Answered by:
'inet_addr': Use inet_pton() or InetPton() instead or define _WINSOCK_DEPRECATED_NO_WARNINGS to disable deprecated API warnings

Question
-
Answers
-
Hi,
Which version of visual studio do you use? Is it VS2013 with update 3?
Based on your description, please make sure you define _WINSOCK_DEPRECATED_NO_WARNINGS before all the include.
Another way you may have a try is to add #include <WS2tcpip.h> and use inet_pton(AF_INET, IP, buf) to instead of inet_addr(IP).
In addition, you can check if your properties is settings like this: Project properties -> Configuration Properties -> C/C++ -> General -> SDL checks -> No.
May
We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
Click HERE to participate the survey.- Marked as answer by MrCapybara Wednesday, September 3, 2014 12:26 AM
All replies
-
Hi,
Which version of visual studio do you use? Is it VS2013 with update 3?
Based on your description, please make sure you define _WINSOCK_DEPRECATED_NO_WARNINGS before all the include.
Another way you may have a try is to add #include <WS2tcpip.h> and use inet_pton(AF_INET, IP, buf) to instead of inet_addr(IP).
In addition, you can check if your properties is settings like this: Project properties -> Configuration Properties -> C/C++ -> General -> SDL checks -> No.
May
We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
Click HERE to participate the survey.- Marked as answer by MrCapybara Wednesday, September 3, 2014 12:26 AM
-
Hi May,
Yes I am using VS2013 with update 3. From what I read about inet_pton I cant seem to use it in XP and older versions of windows, so that is not really an option for me.
As for the property settings, I tried it but it did not solve the problem.
I solved this after defining _WINSOCK_DEPRECATED_NO_WARNINGS in the top line of stdafx.h, as advised by you. Thank you!!!
-