The code below does not compile. I get two errors:
_TCHAR* pStrAddress;
... some stuff here...
IN_ADDR sa;
InetPton(AF_INET, pStrAddress, &sa);
*pIP = sa.S_un.S_addr;
1) IN_ADDR --> error C2065: 'AF_INET': undeclared identifier
2) InetPton(...) --> C3861: 'InetPton': identifier not found
My configuration is as follows:
- VS-2019 pro
- Windows SDK 10.0.18362.0 (Latest as of 9/26/2019)
- When I press F12 (Go to definition) the following files opens in the editor (C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\shared\inaddr.h and C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\um\WS2tcpip.h).
- The project settings "C/C++ | General | Additional include directories" has the "Inherit from parent or project default" checkbox checked.
- Ws2_32.lib is present in "linker | Additional dependencies" (but my question is not about link issue, or not there yet)
- My program uses unicode and InetPton(...) expands to InetPtonW, which is correct.
To resume, from within the editor, the symbols are accessible, but the preprosessor/compiler don't seem to have the same paths. Obviously I am missing something most probably obvious. Your help will be immensely appreciated.
Thanks!