User forums > Help
Winsock Wont compile
(1/1)
astropirate:
Greetings all!
I have been having this issue for a while. I cannot compile anything with winsock.
i attempted to compile http://msdn.microsoft.com/en-us/library/ms737593(VS.85).aspx i included all the requred libraries but it would still not compile. it says
--- Quote ---error: `getaddrinfo' was not declared in this scope
error: `freeaddrinfo' was not declared in this scope
--- End quote ---
which are in "ws2tcpip.h"
Any help please?
P.S
the code compiles fine when i use Dev-C++ but i personal prefer C::B :lol:
astropirate:
Ok solution for those of you who have stumbled upon this while searching for the solution to the same problem
add:
--- Code: ---#define _WIN32_WINNT
#define _WIN32_WINNT 0x501
--- End code ---
Before your includes.
You would think Code::Blocks would do it for you... <_<
MortenMacFly:
--- Quote from: astropirate on April 22, 2009, 07:05:20 am ---You would think Code::Blocks would do it for you... <_<
--- End quote ---
Why should it? What if I want to pass a different version?
It's up to the developer to pass needed DEFINES as arguments to the compiler. Check your project options -> Compiler -> Defines.
Navigation
[0] Message Index
Go to full version