'getaddrinfo' not declared

I tried running this example code, but I keep getting this error:
error: 'getaddrinfo' was not declared in this scope

http://msdn.microsoft.com/en-us/library/windows/desktop/ms738520%28v=vs.85%29.aspx

Also a warning: ignoring #pragma comment (-Wunknown-pragmas)

Any ideas what might be happening?

CodeBlocks, Windows 8.1
You may have to set the Windows Version macro thing, WIN_VER or WINVER, ... can't remember and don't program Windows anymore.

This might help: Using the Windows Headers
http://msdn.microsoft.com/en-gb/library/windows/desktop/aa383745%28v=vs.85%29.aspx
Thanks, but turns out I had an old version of ws2tcpip.h which I now download from here
http://sourceforge.net/p/mingw/mingw-org-wsl/ci/master/tree/include/ws2tcpip.h
Topic archived. No new replies allowed.