Cannot open include file windows h no such file or directory

Cannot open Windows.h in Microsoft Visual Studio

First of all: I’m using Microsoft Visual Studio 2012

I am a C#/Java developer and I am now trying to program for the kinect using Microsoft SDK and C++. So I started of with the Color Basics example, and I can not get it to compile. At first, none of the classes were able to find Windows.h. So I installed (Or re-installed, I’m not sure) the Windows SDK, and added the include dir of the SDK to the include «path» of the project. Then all the problems were gone, except for one:

And thats the error. No reasons why, the system can find it because it is used in multiple other files, only this file is not able to work with it. As a reference, the entire file that is bugging (ColorBasics.rc):

Cannot open include file windows h no such file or directory. Смотреть фото Cannot open include file windows h no such file or directory. Смотреть картинку Cannot open include file windows h no such file or directory. Картинка про Cannot open include file windows h no such file or directory. Фото Cannot open include file windows h no such file or directory

Cannot open include file windows h no such file or directory. Смотреть фото Cannot open include file windows h no such file or directory. Смотреть картинку Cannot open include file windows h no such file or directory. Картинка про Cannot open include file windows h no such file or directory. Фото Cannot open include file windows h no such file or directory

7 Answers 7

If you already haven’t done it, try adding «SDK Path\Include» to:

And add «SDK Path\Lib» to:

Also, try to change «Windows.h» to

If won’t help, check the physical existence of the file, it should be in «\VC\PlatformSDK\Include» folder in your Visual Studio install directory.

Cannot open include file windows h no such file or directory. Смотреть фото Cannot open include file windows h no such file or directory. Смотреть картинку Cannot open include file windows h no such file or directory. Картинка про Cannot open include file windows h no such file or directory. Фото Cannot open include file windows h no such file or directory

Start Visual Studio. Go to Tools->Options and expand Projects and solutions. Select VC++ Directories from the tree and choose Include Files from the combo on the right.

If this is missing, you found a problem. If not, search for a file. It should be located in

C:\Program Files\Microsoft SDKs\Windows\v6.0A\Include

C:\Program Files (x86)\Microsoft SDKs\Windows\v6.0A\Include

if VS was installed in the default directory.

Cannot open include file windows h no such file or directory. Смотреть фото Cannot open include file windows h no such file or directory. Смотреть картинку Cannot open include file windows h no such file or directory. Картинка про Cannot open include file windows h no such file or directory. Фото Cannot open include file windows h no such file or directory

If you are targeting Windows XP ( v140_xp ), try installing Windows XP Support for C++.

Starting with Visual Studio 2012, the default toolset (v110) dropped support for Windows XP. As a result, a Windows.h error can occur if your project is targeting Windows XP with the default C++ packages.

Cannot open include file windows h no such file or directory. Смотреть фото Cannot open include file windows h no such file or directory. Смотреть картинку Cannot open include file windows h no such file or directory. Картинка про Cannot open include file windows h no such file or directory. Фото Cannot open include file windows h no such file or directory

Open the Visual Studio Installer and click Modify for your version of Visual Studio. Open the Individual Components tab and scroll down to Compilers, build tools, and runtimes. Near the bottom, check Windows XP support for C++ and click Modify to begin installing.

Источник

“Cannot open include file: ‘config-win.h’: No such file or directory” while installing mysql-python

I’m trying to install mysql-python in a virtualenv using pip on windows. At first, I was getting the same error reported here, but the answer there worked for me too. Now I’m getting this following error:

If I symlink (Win7) to my regular (not the virtualenv’s) python’s site-packages/MySQLdb dir I get

I’m rather at a loss here. Any pointers?

22 Answers 22

Update for mysql 5.5 and config-win.h not visible issue

In 5.5 config-win. has actually moved to Connector separate folder in windows. i.e. smth like:

C:\Program Files\MySQL\Connector C 6.0.2\include

To overcome the problem one need not only to download «dev bits» (which actually connects the connector) but also to modify mysqldb install scripts to add the include folder. I’ve done a quick dirty fix as that.

in setup_windows.py locate the line

Ugly but works until mysqldb authors will change the behaviour.

Almost forgot to mention. In the same manner one needs to add similar additional entry for libs:

i.e. your setup_windows.py looks pretty much like:

All I had to do was go over to oracle, and download the MySQL Connector C 6.0.2 (newer doesn’t work!) and do the typical install.

Be sure to include all optional extras (Extra Binaries) via the custom install, without these it did not work for the win64.msi

Once that was done, I went into pycharms, and selected the MySQL-python>=1.2.4 package to install, and it worked great. No need to update any configuration or anything like that. This was the simplest version for me to work through.

Cannot open include file windows h no such file or directory. Смотреть фото Cannot open include file windows h no such file or directory. Смотреть картинку Cannot open include file windows h no such file or directory. Картинка про Cannot open include file windows h no such file or directory. Фото Cannot open include file windows h no such file or directory

The accepted solution no longer seems to work for newer versions of mysql-python. The installer no longer provides a site.cfg file to edit.

The accepted answer is out of date. Some of the suggestions were already incorporated in the package, and I was still getting the error about missing config-win.h & mysqlclient.lib.

pip install mysql-python

P.S. Since I don’t use MySQL anymore, my answer may be out of date as well.

I know this post is super old, but it is still coming up as the top hit in google so I will add some more info to this issue.

I was having the same problems as OP but none of the suggested answers seemed to work for me. Mainly because «config-win.h» didn’t exist anywhere in the connector install folder.

I was using the latest Connector C 6.1.6 as that was what was suggested by the MySQL installer.

This however doesn’t seem to be supported by the latest MySQL-python package (1.2.5). When trying to install it I could see that it was explicitly looking for C Connector 6.0.2.

Источник

Getting “Cannot open include file: ‘atlbase.h’: No such file or directory” error

I am swapping machines (between two Windows 8.1 laptops) and have just loaded the project I’m working on from TFS. On one machine it compiles, on the other it does not and gives the first error

On both laptops I am running Visual Studio Ultimate 2013. On the first laptop I’ve checked to see where it is picking up atlbase.h and it is from C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\atlmfc\include i.e. from the Visual Studio 2012 installation directory. On the new machine I do not have Visual Studio 2012 installed so the directory C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\atlmfc\include does not exist.

Other people have similar problems (e.g. Ramilol’s question) because they are using Visual Studio Express. I am using Ultimate.

Let me have another go at wording this question.

How do I check what those macros are set to, and if they are not where atlbase.h is (i.e. C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\atlmfc\include ) how do I fix that?

========== EDIT 2: Microsoft Visual C++ Redistributables installed ==========

Responding to jp2code’s answer the machine that works and the one that does not have a similar array of Microsoft Visual C++ Redistributables installed as the following screenshot shows (the working machine’s on the left):

Cannot open include file windows h no such file or directory. Смотреть фото Cannot open include file windows h no such file or directory. Смотреть картинку Cannot open include file windows h no such file or directory. Картинка про Cannot open include file windows h no such file or directory. Фото Cannot open include file windows h no such file or directory

========== EDIT 3: Environment variables ==========

In his answer, pje explains how to look up the environment variables. %VCInstallDir% is correctly set to C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\ But if I right click on the line #include I get this error which suggests that despite %VCInstallDir% being correct, that is not where VS is looking:

Cannot open include file windows h no such file or directory. Смотреть фото Cannot open include file windows h no such file or directory. Смотреть картинку Cannot open include file windows h no such file or directory. Картинка про Cannot open include file windows h no such file or directory. Фото Cannot open include file windows h no such file or directory

========== EDIT 4: Platform toolkit setting ==========

If I start a new C++ Windows Store project I can set Platform Toolset to Visual Studio 2013 (v120) without issue, in fact it is the only option listed in the drop-down. (N.B. The new project has Target Platform Version set to ‘Windows 8.1’, and it is greyed out, so I cannot change it, while the failing project has it set to Windows 8.)

========== EDIT 5: Entire project settings file ==========

========== EDIT 6: Uninstalling and reinstalling Visual Studio 2013 Ultimate ==========

Источник

Cannot open include file with Visual Studio

I have recently gone from Code::Blocks to Visual Studio, and in Code::Blocks one could just add a class and then include it straight away. However, whenever I do the same in Visual Studio with the following statement:

It doesn’t work and instead I get the error:

cannot open include file: ‘includedFile.h’; no such file or directory.

Is there some box or setting that I have to tick? Or do I have to add each header as a dependency manually?

Here is the code for the class in question:

Public.h:

How it is being included:

8 Answers 8

Please check your actual directory for the presence of the include file. Putting it into the «header files» folder in project/solution explorer was not enough.

Cannot open include file windows h no such file or directory. Смотреть фото Cannot open include file windows h no such file or directory. Смотреть картинку Cannot open include file windows h no such file or directory. Картинка про Cannot open include file windows h no such file or directory. Фото Cannot open include file windows h no such file or directory

And be sure that your Configuration and Platform are the active ones. Example: Configuration: Active(Debug) Platform: Active(Win32).

You need to set the path for the preprocessor to search for these include files, if they are not in the project folder.

You can set the path in VC++ Directories, or in Additional Include Directories. Both are found in project settings.

By default, Visual Studio searches for headers in the folder where your project is ($ProjectDir) and in the default standard libraries directories. If you need to include something that is not placed in your project directory, you need to add the path to the folder to include:

You can, also, as suggested by Chris Olen, add the path to VC++ Directories field.

I found this post because I was having the same error in Microsoft Visual C++. (Though it seems it’s cause was a little different, than the above posted question.)

I had placed the file, I was trying to include, in the same directory, but it still could not be found.

My include looked like this: #include

But When I changed it to this: #include «ftdi.h» then it found it.

If your problem is still there it’s certainly because you are trying to compile a different version from your current settings.

For example if you set your Additional Include Directories in Debug x64, be sure that you are compiling with the same configuration.

For me, it helped to link the projects current directory as such:

If you’ve tried the other answers and your include file still can’t be found, here are some additional debugging steps and sanity-checks:

Источник

I am trying to Build a Solution on Visual Studio Community 2017, but I keep getting the error «Cannot open include file: ‘stdio.h’ «. I’ve read through several similar questions, but still can’t fix this problem. Looks like the stdio.h file is called in the stdafx.h file. Below are more details. Any suggestions? (I can’t embed images yet, so please click on the links for screenshots.)

System details: Windows 10
Visual Studio Community 2017 v.15.2 (26430.6)
— Installed Desktop Development with C++ (Screenshot: Installation list)

Step 1: I wrote the famous Hello World program in C++.

Step 2: I clicked on Build > Build Solution.

Problem: ‘stdio.h’: No such file or directory. Full Error:

Troubleshooting details/Things I’ve tried:

Code in stdafx.cpp file:

Code in stdafx.h file:

NOTE: the #include for and both have the red squiggle line underneath, and says «cannot open source file».
TRIED: I tried removing the last two lines, but then I got more errors.

12 Answers 12

Got same problem with project porting from VS2013 to VS2017,
Fix: change «Properties->General->Windows SDK Version» to 10

Cannot open include file windows h no such file or directory. Смотреть фото Cannot open include file windows h no such file or directory. Смотреть картинку Cannot open include file windows h no such file or directory. Картинка про Cannot open include file windows h no such file or directory. Фото Cannot open include file windows h no such file or directory

Faced the problem of missing stdlib.h and stdio.h (and maybe more) after installing VS2017 Community on a new computer and migrating a solution from VS2013 to VS2017.

Used @Maxim Akristiniy’s proposal, but still got error message regarding toolset compatibility. However VS itself suggested to do solution retarget by right-clicking on the solution in Solution Explorer, then selecting Retarget solution from the menu and the updated Windows SDK Version from the drop-down list.

Now my projects build w/o a problem.

Note that you may need to make the project your startup project for the retargeting to catch.

There are three ways to solve this issue.

Reinstall Visual Studio
This also worked for me, because I realized that maybe there was something wrong with my Windows SDK. I was using Windows 10, but with Windows SDK 8.1. You may have this problem as well.
Steps: Open Visual Studio Installer > Click on the three-lined Menu Bar > Uninstall > Restart your computer > Open Visual Studio Installer > Install what you want, but make sure you install only the latest Windows SDK 10, not multiple ones nor the 8.1.

The first time I installed Visual Studio, I would get an error stating that I needed to install Windows SDK 8.1. So I did, through Visual Studio Installer’s Modify option. Perhaps this was a problem because I was installed it after Visual Studio was already installed, or because I needed SDK 10 instead. Just to be safe I did a complete reinstall.

Источник

Добавить комментарий

Ваш адрес email не будет опубликован. Обязательные поля помечены *