-
winsock2.h problem
Hi all. I am using Visual C++ Express 2008 Edition and am trying to write a simple internet application, however, I can't seem to get winsock2.h to include right. The compiler keeps coming up with errors about redefinition for some reason. Is it that winsock.h is included in windows.h? I can't figure this one out!
-
Yep. It sure is. Just include windows.h second.
There is a common way of doing this too...
#define WIN32_LEAN_AND_MEAN
#include <windows.h>
#include <winsock2.h>
But my gripe about that method is sometimes you need some of the stuff that lean and mean removes.