6

I have this error while compiling my Visual C++ project in Visual Studio 2008 on XP. How to resolve this error :(

Error   1   fatal error C1083: Cannot open include file: 'winsock2.h': No such file or directory    c:\program files\microsoft visual studio 9.0\vc\atlmfc\include\atlbase.h    68  WOT
barlyee
  • 409
  • 4
  • 10
  • 19
  • Is there any additional SDK that I need to install beside my VS2008? – barlyee Sep 02 '10 at 00:57
  • Casual solution: `#ifdef _WIN32 #define WIN32_LEAN_AND_MEAN #include #include #pragma comment(lib, "ws2_32") #endif` including windows first avoids future problems but possible only if you have defined `WIN32_LEAN_AND_MEAN` – Sandburg Nov 14 '18 at 15:25

2 Answers2

10

Your Windows SDK is not configure correctly. The easiest way to fix this is to install Windows 7 SDK. (yes, you can install it on windows xp and develop for xp)

J-16 SDiZ
  • 25,723
  • 3
  • 63
  • 83
  • 2
    See http://msdn.microsoft.com/en-us/windows/desktop/ff851942.aspx for list of Windows SDK for varying operating systems and frameworks. – Will B. Oct 29 '14 at 15:38
  • installtion of windows 7 SDK is failing for me. I guess it becuase I have VS 2013 installed on my machine. is there any other workaround ? – SharpCoder May 21 '15 at 11:46
-3

simply go to project->project properties linker->input in additional dependencies add ws2_32.lib linker ->command line add here ws2_32.lib click start

denis
  • 11
  • 1