cplusplus
.com
TUTORIALS
REFERENCE
ARTICLES
FORUM
C++
Tutorials
Reference
Articles
Forum
Forum
Beginners
Windows Programming
UNIX/Linux Programming
General C++ Programming
Lounge
Jobs
Forum
Windows Programming
'getaddrinfo' not declared
'getaddrinfo' not declared
Nov 27, 2014 at 5:09pm UTC
zoran404
(263)
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
Nov 27, 2014 at 6:38pm UTC
kbw
(9488)
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
Nov 27, 2014 at 11:29pm UTC
zoran404
(263)
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.