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:
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!
Found it! I created a small project with just the code of interest to post as an example of code and everything was compiling fine. So, something must be obvious in the first place. Then it hit me!: The precompiled header was not the first include.
Thanks guys for your help!
BAD code:
#include <windows.h>
#include <ws2tcpip.h>
#include <stdlib.h>
#include "pch.h" <-- this must be the first include!!!!!!
GOOD code:
#include "pch.h" <-- ok, happy compiler and developer ;)
#include <windows.h>
#include <ws2tcpip.h>
#include <stdlib.h>