Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

error C1083: cannot open include file: 'winsock2.h': No such file or directory

Visual Studio 2013 returns this error when I tried to build a Snare (http://www.intersectalliance.com/projects/BackLogNT/) project.

I installed the Windows SDK and I realized that I am supposed to include the SDK path into my project. Could anyone explain how to include the SDK path into a Visual Studio project?

like image 389
Sai Wai Maung Avatar asked Jan 09 '14 19:01

Sai Wai Maung


3 Answers

The answer by user2644318 is quite hardcoded. An alternative is to try this: - Open the Project properties - Goto Configuration Properties -> General - Set the Platform Toolset to v120_xp (Visual Studio 2013 - Windows XP) - Recompile

Funnily enough I can mix toolsets for libraries; they link fine. Ofcourse, this only gets you XP interface capabilities.

like image 103
Ruud van Gaal Avatar answered Nov 14 '22 12:11

Ruud van Gaal


I think answer of Ruud van Gaal is more correct. What I did: - install Windows SDK for Windows XP (7.1) from here http://www.microsoft.com/en-us/download/details.aspx?id=8279

  • open the Project properties - Goto Configuration Properties -> General - Set the Platform Toolset to "Visual Studio 2013 - Windows XP (v120_xp)"

  • after this Include/Libraries paths were changed to correct folders $(VC_IncludePath);$(WindowsSdk_71A_IncludePath); $(VC_LibraryPath_x86);$(WindowsSdk_71A_LibraryPath_x86);

So I did NOT change them manually. Only targeting correct tool set and everything started to work.

like image 41
Igor Slepchenkov Avatar answered Nov 14 '22 13:11

Igor Slepchenkov


In Visual Studio 2013, under Solution Explorer, right click on the project -> Properties -> Configuration Properties -> VC++ Directories, then include (WindowsSDK_IncludePath_um); in Include and Library Directories. I was able to solve this issue with this approach.

like image 21
Sai Wai Maung Avatar answered Nov 14 '22 13:11

Sai Wai Maung