Visual Studio 2013: fatal error C1083: Cannot open include file: 'winsock2.h': No such file or directory - c++

I migrated some "native" c++ projects from Visual Studio 2010 on Windows 7 to Visual Studio 2013 on Windows 8.1. Rebuilding gave me this error. I realized I did not have the Windows SDK installed, so I installed that next, but I'm still getting the error. Anyone else get this on otherwise-clean VS project migrations?

I searched under the SDK folder for the missing file and found it. Because the SDK was installed after I migrated the projects, the paths were not included in my projects. I was able to fix everything by adding to my include and lib paths.
I added the following folders to my include paths:
$(WindowsSdkDir)include\um
$(WindowsSdkDir)include\shared
My full include path for both Debug and Release now looks like this:
$(WindowsSdkDir)include;$(WindowsSdkDir)include\um;$(WindowsSdkDir)include\shared;$(FrameworkSDKDir)\include;$(VCInstallDir)include;$(VCInstallDir)atlmfc\include;
I added the following folder to my lib paths (note that is specific to a 32-bit build! see x64 for 64-bit, and arm for arm builds...):
$(WindowsSdkDir)lib\winv6.3\um\x86
My full lib path looks like this:
$(WindowsSdkDir)lib;$(WindowsSdkDir)lib\winv6.3\um\x86;$(FrameworkSDKDir)\lib;$(VCInstallDir)lib;$(VCInstallDir)atlmfc\lib
Note that if you have a copy of the original project file, you can also fix the problem by re-migrating it again after the Windows SDK is installed.

include path: $(VC_IncludePath);$(WindowsSDK_IncludePath);
lib paths:$(VC_LibraryPath_x86);$(WindowsSDK_LibraryPath_x86);

Related

Getting hundreds of import errors when running boilerplate code in Visual Studio

Recently I tried opening up Visual Studio 2019 because I wanted to try I new IDE when I was met with hundreds of errors upon running standard boilerplate c++ code. More specifically import errors. I have tried installing the newest version of Visual Studio, have tried adding the path manually to the "Additional Include Directories and modifying my installation but nothings worked.
Update: In the build errors I got the following error
fatal error C1083: Cannot open include file: 'crtdbg.h': No such file or directory
and when I checked the directory where I would expect the header file to be it wasn't there.
1.Check the C++ windows sdk version in VS Installer.
2.Make sure that the installed windows sdk is selected in your project properties.

Cannot open include file: 'atlrx.h' in Visual Studio 2019

We are upgrading the compiler from Visual Studio 2013 to Visual Studio 2019.
Getting the below error while building the project which used regex expressions:
Cannot open include file: 'atlrx.h': No such file or directory
After installing the ATL/MFC Components also atlrx.h is not fond in the VS include directory.
Does anyone have any idea like which component should be installed to get rid of this error?
Thanks in advance.
You should download ATL server from Codeplex and install the files.
ATL Server: Visual C++ shared source software
And then copy the include file to a folder on your hard disk, Atlrx.h normally lives in the $(VCInstallDir)VC\atlmfc\include folder.
You should make sure that this path is added in the include directories of visual studio.

Cannot open include file: 'ctype.h': No such file or directory

I installed c++ package on VS 2015 , if I tried to build the project ,the following problem appears :
C1083 Cannot open include file: 'ctype.h': No such file or directory Win32Project5 c:\program files (x86)\windows kits\8.1\include\um\winnt.h 31
Any possible solution ....
Repair / Reinstall visual studio.
Make sure that the Windows SDK option (Probably 8.1 in your case) is ticked,
As you can see in this picture:
To add the missing component, go to Control Panel -> Uninstall a Program, and select to Change the installation of Visual Studio.
Then, here is the option you need to check:
Then press "Modify".
Also don't forget to update the project's Properties to be using Windows SDK version 10.0.17134.0.
Right click on your solution or project in the solution explorer
& Retarget your solution or project to the installed SDK version
Here is mine VS 2017 build tools configuration to make Python 3.7 and up to compile on my local machine and fix. Please notice that MS changed VS Studio Build Tools interface
In order to make code to compile you also MUST to install ODBC driver
You can download VS 2017 Build tools from:
https://visualstudio.microsoft.com/downloads/

Visual Studio 2012 using platform toolset v100. Cannot open source file "atlbase.h"

I am using Visual Studio Ultimate 2012. I have a project that works when i use the default v110 platform toolset.
Now I would like to add the Point Cloud Library (PCL) to this project to further work on it. Unfortunately there are only binaries available for Visual Studio 2010. I first tried to compile the 2012 binaries myself but that turned out to be more trouble than its worth. So i changed my platform toolset to v100 in order to use the PCL prebuilt binaries.
However, when doing so, one of my includes (atlbase.h) is no longer recognized. I have tried to manually include this by adding the Include and Library Directories of ATL in the project properties. This generated a whole lot of new errors, originating from the atl header files, which seems odd. I have also tried changing the option "Use of ATL" to "Dynamic Link to ATL" and "Static Link to ATL" from the default "Not Using ATL" to no avail.
I'm working on a 64 bit Windows 7 Ultimate machine and want to compile in 32 bit.
Edit: Using Process Monitor I have found that Visual Studio is looking for the include file in C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\atlmfc\include\atlbase.h.
This folder (..\atlmfc) does not exist.
My VS2012 is installed at D:\School Programs\Visual Studio 2012
Is there a fix for this?
When you Switch to another different toolset this complete toolset must be available. This includes also the header files.
It should be possible without great Trouble to convert this DLL into VS 2012. Or myabe you can include the complete source without using a separate DLL.
Download and install WDK 7.1 (microsoft.com/en-us/download/confirmation.aspx?id=11800)
Create an environment variable which points to the installation directory, I called mine WINDDK
Go to project Properties -> VC++ Directories
Add $(WINDDK)\inc\atl71 to Include Directories
Add $(WINDDK)\lib\ATL\i386 to Library Directories (this is for 32 bit)
Go to project Properties -> Linker -> Input
Add atl.lib to Additional Dependencies
These steps have solved my problem

Compiling wxWidgets 2.8.12 and 2.9.3 under Visual Studio 11 Beta

I tried tried to compile wxWidgets and got errors pertaining to missing "wx/setup.h" header file.
wxMSW-2.8.12\include\wx/platform.h(196): fatal error C1083: Cannot open include file: 'wx/setup.h': No such file or directory
Are there simple configuration changes that I can make to allow me to compile the libraries?
Environment
Windows 7 64-bit
Visual C++ 11 Beta
fyi: I have successfully built wxWidgets on this machine using Visual C++ 9.
setup.h is actually in the "msvc" directory next to "wx" in "include". You need to include the msvc folder as well and it should work.
Compiling from command line should work, see http://wxwidgets.blogspot.com/2012/02/building-wxwidgets-with-microsoft.html (although I only tested this with 2.9, not 2.8). Notice that you should use a different COMPILER_PREFIX to avoid conflicts between your existing VC9 build and this one, e.g. nmake -f makefile.vc COMPILER_PREFIX=vc100.
If you use project files then you should check that importing VC9 versions worked correctly, perhaps something bad has happened during the import process.