When building my app, I get "identifier not found" when building in Release mode for the inet_ntop function. However, no error occurs when building in Debug mode. Any ideas how I can get it to compile in Release mode?
Asked
Active
Viewed 587 times
1
-
Try to link `Ws2_32.lib` library to your project and include `Ws2tcpip.h` header file where you use `inet_ntop` function. And I usualy use `InetNtop` function in Visual Studio projects (https://msdn.microsoft.com/en-us/library/windows/desktop/cc805843(v=vs.85).aspx). – gomons Mar 07 '16 at 22:30
-
1Possible duplicate of ['inet\_pton': identifier not found](http://stackoverflow.com/questions/15660203/inet-pton-identifier-not-found) – gomons Mar 07 '16 at 22:32
-
I already had Ws2_32.lib linked as an additional dependency and included Ws2tcpip.h in the header file. I changed the code to use InetNtop and I'm still getting the error. Is there something else I'm missing? – M. Ramos Mar 08 '16 at 12:56
-
What is your windwos version? `InetNtop` is actually a macro. Are `InetNtopA` or `InetNtopW` functions available for your source file? Try include `Winsock2.h`. Is `Windows.h` header included? If you use `Windows.h`, try to rearrange inlucde order, change `Windows.h` with `Winsock2.h` or `Ws2tcpip.h`. – gomons Mar 08 '16 at 14:58
-
I'm using Windows 7 Enterprise. – M. Ramos Mar 08 '16 at 15:13
-
May be this can help: http://stackoverflow.com/questions/4890753/inetntop-cant-find-which-header-it-is-using – gomons Mar 08 '16 at 15:29
-
I can't reproduce your problem, I think that problem in project defines. – gomons Mar 08 '16 at 15:36
-
Thank you for your help. I was a project defines issue. – M. Ramos Mar 08 '16 at 20:05
-
Could you create an answer with steps how to solve this problem. I think it can be helpful for other users. – gomons Mar 09 '16 at 17:52
-
1This is what I did: 1. Changed Windows.h with Winsock2.h or Ws2tcpip.h. 2. Went into Configuration Properties->C/C++->Preprocessor Definitions changed WINVER=0x06010000 since I’m running on Windows 7 – M. Ramos Mar 10 '16 at 20:47
1 Answers
0
I faced similar issue on Windows 10. I just changed _WIN32_WINNT=0x0A00 in Project Configuration Properties->C/C++->Preprocessor Definitions.

Abhijeet Sawant
- 21
- 2