Fatal error windows h no such file or directory

Hell'o I've just installed Visual Studio 2017 (enterprise).I opened my project whom I created in Visual Studio 2015. My project uses windows.h library but VS2017 cannot find this library. How to re...

Hell’o
I’ve just installed Visual Studio 2017 (enterprise).I opened my project whom I created in Visual Studio 2015. My project uses windows.h library but VS2017 cannot find this library. How to repair this?

Mike Kinghan's user avatar

Mike Kinghan

53.8k11 gold badges147 silver badges174 bronze badges

asked Apr 14, 2017 at 11:28

Marcin Klima's user avatar

3

My solution was :

  • Open the project properties
  • Into General —> SDK Version
  • I just picked the 10.0.15063.0 version instead of 8.1

And it worked.

answered Aug 14, 2017 at 12:02

ImFonky's user avatar

ImFonkyImFonky

8151 gold badge7 silver badges8 bronze badges

1

I solved this issue by re-running the Visual Studio Installer and selecting the «Modify» button. Once presented with the Workloads screen I clicked on the «Individual Components» tab and selected all of the latest «Windows 10 SDK» Checkboxes(version 10.0.15063.0). My guess is that the entry for «Desktop C++ x86 and x64» is the one the actually fixes it but it is only speculation because none of those options were checked when I ran the installer and as you can see I checked all of them.

enter image description here

answered Apr 17, 2017 at 21:58

James Pack's user avatar

James PackJames Pack

8241 gold badge10 silver badges19 bronze badges

2

This happens when you have customized include/library paths in legacy projects. If you added your own additional paths in project properties, VisualStudio 2017 can’t automatically figure out base paths when switching between platforms/toolsets — normally it automatically puts correct paths there, but if you added customizations, VS won’t touch them.

This is legitimate problem which I ran into myself recently when migrating old project targeted for Windows XP into VS2017. None of the answers or comments listed/linked here so far are helpful. I have all legacy SDKs in VisualStudio 2017 installer, and none of that fixed VS not finding essential includes such as <windows.h>. In my case the project was using v120 toolset from VS2013, which is superseded by v140_xp in newer VS.

After setting correct platform and toolset understood by VS2017, I did the following to resolve the problem:

  • Open project properties, go to VC++ Directories, for ‘Include Directories’ and for ‘Library Directories’, choose <Inherit from parent or project defaults>. This will remove your additional paths.

  • Click ‘Apply’. This will reset include path to something like $(VC_IncludePath_x86);$(WindowsSdk_71A_IncludePath_x86) (will vary for SDKs).

  • Re-add your extra paths here, or better yet — under C/C++/General -> Additional Include Directories and Linker/General -> Additional Library Directories.

answered Jul 6, 2017 at 9:03

Cozzamara's user avatar

CozzamaraCozzamara

1,2881 gold badge14 silver badges22 bronze badges

2

I got it fixed when I simply changed «General => Windows SDK version» to a different version, submitted the changes and then changed it back.

answered Jun 17, 2019 at 5:05

Aivar's user avatar

AivarAivar

6,6745 gold badges46 silver badges75 bronze badges

The problem occurs when you migrate your C++ project from a more updated visual studio version to a lesser one.
To solve the issue simply go to your :
Project’s properties—>General—>SDK Version [and here unroll to show installed SDK versions so you downgrade to an available version {Since the required one seems unavailable hence the error}].
Once one of the Available SDKs selected, Apply, and go back to your code, and everything gonna get fixed.

answered Jan 15, 2019 at 10:52

Thanos's user avatar

If the installation was ok it should be here:

C:Program Files (x86)Windows Kits10Include10.0.15063.0umWindows.h

So be sure it is on the include path of the project properties.

Project properties

Or if you prefer by manual edit in the .vcxproj file at the IncludePath Tag line:

<IncludePath>$(VC_IncludePath);$(WindowsSDK_IncludePath);C:Program Files (x86)Windows Kits10Include10.0.15063.0um;C:Program Files (x86)Windows Kits10Include10.0.15063.0shared;</IncludePath>

answered Sep 26, 2017 at 20:57

Zanna's user avatar

ZannaZanna

6569 silver badges13 bronze badges

TL;DR: make sure the checkbox, marked below, is checked.

In the Include Directories Dlgbox, there’s an option at the bottom «Inherit from…» that needs to be checked. Somehow it got unchecked after moving a project to a different solution.

So, in my case, resetting to defaults and adding custom paths again wasn’t even needed.
Screenshot

answered May 6, 2020 at 11:39

Erik Bongers's user avatar

You have to go in Visual Studio 2017 Installer, choose Individual Components, and manually select and install Windows 8.1 SDK.

answered Jun 17, 2017 at 1:42

Mardulu's user avatar

This step work for me.
1. Open visual studio installer
2. at menu «Visual studio comunity 2017» —> click modify
3. at desktop development with c++ —> enable windows10 SDK for desktop and windows 8.1 SDK
4. click modify

answered Oct 17, 2017 at 3:28

chokelive's user avatar

I’ve also installed Visual Studio 2017 (community) first with the default composition settings.I opened my project whom I created in Visual Studio 2015. My project uses windows.h library but VS2017 cannot find this library and other problems. At first I install the missing (SDK 10 … etc.) components. Part of problems is gone, but windows.h still not found. The problem was solved by completely uninstalling VS2017 and then installing with all the options at once.

answered Feb 18, 2018 at 13:27

Serg Tsaregorodtsev's user avatar

My solution was checking paths.

Include Directories:

C:Program Files (x86)Windows Kits10Include10.0.17763.0um;
C:Program Files (x86)Windows Kits10Include10.0.17763.0shared;
%(AdditionalIncludeDirectories)

Library Directories:

C:Program Files (x86)Microsoft Visual Studio2017CommunityVCToolsMSVC14.16.27023libx64

and then right click Solution Explorer: Solution ‘xxxxx’ (1 project) line click «Retarget solution»

Remember to set Debug setting for Symbols fetch — Windows 10 must use Microsoft symbol server!

tuomastik's user avatar

tuomastik

4,3815 gold badges35 silver badges47 bronze badges

answered Feb 1, 2019 at 5:22

Pekka Kalevi Ylönen's user avatar

I’ve just installed VS2015 Community. 

I didn’t uninstall VS2010. 

It converted a large application I’m currently working on. 

I’m getting this error — fatal error C1083: Cannot open include file: ‘windows.h’: No such file or directory

Here is some new code I just created using the empty template, multi char instead of UTF 16:

#include <windows.h>

INT_PTR CALLBACK simple_2015_dialog_box(HWND hdlg,
                                        UINT message,
                                        WPARAM wParam,
                                        LPARAM lParam);

int WINAPI WinMain(HINSTANCE hinstance, 
                   HINSTANCE hPrevInstance,
                   PSTR szCmdLine, int iCmdShow)
{
     DialogBox(hinstance,
               "SIMPLE_2015_DIALOG", NULL,
               (DLGPROC)simple_2015_dialog_box);
}

INT_PTR CALLBACK simple_2015_dialog_box(HWND hdlg,
                                        UINT message,
                                        WPARAM wParam,
                                        LPARAM lParam)
{
}

There might be a lot of problems in this little piece of code, I just tossed it together. I didn’t even bother building the dialog template. 

However, the only error it reports is — fatal error C1083: Cannot open include file: ‘windows.h’: No such file or directory

I searched the C drive for windows.h and found nothing. 

I’ve found Microsoft’s search tool useless since Win 7.  Here is what it came up with when looking for windows.h.

Why do I need to scroll through 209 files with names like

  amd64_microsoft.windows.c..-controls.resources_6595b64144ccf1df_5.82.10586.0_hu-hu_396d25395bc70435_comctl32.dll.mui_0da4e682

when I’m searching for a file with the name of «windows.h»?  I’ve looked for a forum on MS’s search feature, with no luck. 

Anyway, the search finds no file named windows.h. 

Why can’t I find VS2010’s windows.h file?

What am I doing wrong?

Thanks
Larry

  • Edited by

    Thursday, March 24, 2016 6:08 PM

  • Remove From My Forums
  • Question

  • WOW, I can’t believe this information isn’t easier to find.  I downloaded and installed Visual C++ 2005 Express, and then downloaded and installed the Platform SDK SP2.  NOTHING WORKS!  The Directories are not found and there is no apparent way to set them.  Apparently users have found a hack to make it work, but this is crazy.  It seems like the first Microsoft person to install this would notice that it doesn’t work and would raise the flag to the appropriate people so they can take the steps to fix it for their users.  Or at least document it on the very first page where it is downloaded, or the very first page of the documentation.  A user shouldn’t have to hit forums to find out how to make a product work.
    Sorry, I’m not usually one to complain, and I am a big fan of Microsoft.  I guess I’m just hoping they will fix this or let us know what happened. 
    I don’t understand why I have to copy those directories and why I can’t just correct whatever file is pointing to them.  I went to those weird config files and changed them to point to my directories, but it still cannot find windows.h.  Any ideas?

    John

Answers

  •  This article describes what you need to do to build Win32 applications using Visual C++ Express and the Windows SDK for Windows Server 2008 and .NET Framework 3.5.  A more detailed explanation including screenshots can be found here.

    With the Visual Studio 2008 Express versions you can build Win32 applications right out of the box.  You no longer have to manually integrate the Windows SDK content with VC++ Express.

    The Visual Studio 2008 editions are seamlessly integrated with the Windows SDK.  VS2008 editions include the same Vista RTM headers and libraries that shipped in the Microsoft Windows  Software Development Kit Update for Windows Vista released in March, 2007. The SDK tools included with VS2008 editions are more recent than those that ship in the Vista Update SDK and the Windows Server 2003 Platform SDK.

    If you install another SDK, such as the Windows SDK for Windows Server 2008 and .NET Framework 3.5 after you install VS, you are ready to develop with the headers, libraries and tools in the SDK for Windows Server 2008.  Read on if you installed the SDK before installing Visual Studio.  (It’s easy to switch back if you want.) 

    Here’s how:

    Step 1: Install Microsoft Visual C++ 2008 Express.

    Step 2: Install the Windows SDK for Windows Server 2008 and .NET Framework 3.5.

    You’re done.  After installing the Server 2008 SDK, the registry key is set to point to the new Server 2008 SDK (v6.1) content.  If you installed the Windows Server 2008 SDK before you install Visual Studio, you will need to use the SDK Configuration Tool to set the directories.  If you want to switch back to the default (Vista v6.0A) headers and libraries that were installed with VS 2008, you should use the new SDK Configuration Tool to select the v6.0A SDK content.

    Step 3: Use the SDK Configuration Tool to update the Visual C++ directories

    The Windows SDK for Windows Server 2008 includes a new SDK Configuration Tool that sets the Visual Studio include, library and tools directories for you.  This tool allows you to switch quickly between the headers, libraries and tools in the installed Windows SDK(s) and those that are embedded in Visual Studio.  If you install the Windows Server 2008 SDK before you install Visual Studio, you will need to use the SDK Configuration Tool to set the directories manually.

     The SDK Configuration Tool has a GUI interface but it works only on the Visual Studio Retail (non-Express) SKUs.  (This is scheduled be fixed in the next release.) You will use the SDK Configuration tool at the command line with VC++ Express.

    1.       Launch the Windows SDK Command Window (Start, All Programs, Microsoft Windows SDK v6.1, Command Window)

    2.       CD to Program FilesMicrosoftWindowsv6.1Setup>

    3.       Type:  WindowsSdkVer.exe -version:v6.1

    This command will set the Windows SDK for Windows Server 2008 (v 6.1) as the “current” SDK for Visual Studio to use for headers, libraries and tools.  Use ‘-version:v6.1’ for the Windows Server 2008 SDK content.  Use ‘-version:v6.0A’ for the Visual Studio 2008 content. 

    Step 4: Validate that the directories were updated.

    Open the VC++ Express command window and check the PATH to see if the v6.1 directory has been added.

    How to switch directories back to the SDK content that shipped ‘in the box’ with VC++ 2008 Express

    Use the SDK Configuration Tool at the command line to make v6.0A the current version.

    Karin Meier

    Windows SDK Program Manager

    This posting is provided “AS IS” with no warranties, and confers no rights.

    send feedback to wsdkfb@microsoft.com

  • The are a couple of things that you need to remember about the Express Edition:

    1) It is a starter product: the «typical» customer we foresee for the Visual C++ Express Edition is a student who is interested in learning C++.

    2) It is a product that you download: therefore even in these days of broadband we needed to keep down the size of the product.

    Combine these two statements and you see why we didn’t include the Platform SDK — it was just too big. As Ayman, and many other people, have pointed out you can, if you really want the PSDK, then you can download it separately. While there were issues with the integration of the PSDK with the Beta-2 release of the Visual C++ Express Edition these have been fixed with the final Whidbey release.

Опубликовано:
2016-03-31

После установки обновления Update 2 для популярной бесплатной среды программирования Microsoft Visual Studio 2015 Community последовательно возникли две проблемы при сборке проектов C++ с включённой поддержкой Windows XP («General» → «Platform Toolset» → «Visual Studio 2015 — Windows XP (v140_xp)» в свойствах проекта):

  1. IDE не находила заголовочный файл windows.h (главный WinAPI-заголовок), что приводило к «фатальной ошибке» компилятора:

    fatal error C1083: Cannot open include file: ‘windows.h’: No such file or directory

  2. возникала ошибка «Unresolved external» компоновщика при использовании функций типа GetModuleFileNameExW() из стандартной WinAPI-библиотеки Psapi:

    error LNK2019: unresolved external symbol _GetModuleFileNameExW@16 referenced in function […]

    fatal error LNK1120: 1 unresolved externals

windows.h — фатальная ошибка

Судя по всему, для проектов, ориентированных на сборку с поддержкой Windows XP, в значении по умолчанию параметра «Include Directories» в разделе «VC++ Directories» свойств проекта теперь вместо $(WindowsSDK_IncludePath) фигурирует $(WindowsSdk_71A_IncludePath). Это, вероятно, можно трактовать как шаг Microsoft в направлении полного отказа от поддержки Windows XP как целевой платформы в Visual Studio.

Соответственно, проблему с windows.h можно решить сбросом параметра «Include Directories» на значение по умолчанию («inherit from parent or project defaults») и повторным добавлением прежних дополнительных путей уже к этому новому значению по умолчанию.

Psapi — unresolved external

Что касается Psapi, пришлось добавить ;Psapi.lib в параметр «Additional Dependencies» в разделе «Linker» → «Input» в свойствах проекта; т. е. теперь подключения psapi.h в исходном коде программы недостаточно, и необходимо явным образом подключить ещё и статическую lib-библиотеку. То же, вероятно, касается и некоторых других библиотек.

P. S. Кстати, генерируемые VS 2015 Update 2 исполняемые файлы имеют примерно на 20% больший объём по сравнению с Update 1 при прочих равных.


Цитата
Сообщение от ATAMAN200
Посмотреть сообщение

наскоко мне память не изменяет Visul C++ 2005 Express Editional это не полная версия просто в ней отсутствует инклуд windows.h
Добавлено через 2 минуты
для полной разработки приложений тебе надо Visul C++ 2005 Profissional Editional

Да ну?!!

MACCOP, создаёте новый проект, выбираете «консольное приложение Win 32», обзываете его как-нибудь (к примеру HelloMessage), жмёте кнопку «готово» — в редактор загружается файл HelloMessage.cpp примерно такого содержания:

C++
1
2
3
4
5
6
7
8
9
10
// HelloMessage.cpp: определяет точку входа для консольного приложения.
//
 
#include "stdafx.h"
 
 
int _tmain(int argc, _TCHAR* argv[])
{
    return 0;
}

слева от него есть окно «обозреватель решений», в котором в папке «заголовочные файлы» значится stdafx.h — щёлкаете по нему два раза — он загружается в редактор и вот там добавляете windows.h

C++
1
2
3
4
5
6
7
8
9
10
11
12
13
14
// stdafx.h: включаемый файл для стандартных системных включаемых файлов
// или включаемых файлов для конкретного проекта, которые часто используются, но
// не часто изменяются
//
 
#pragma once
 
#include "targetver.h"
 
#include <stdio.h>
#include <tchar.h>
 
// TODO: Установите здесь ссылки на дополнительные заголовки, требующиеся для программы
#include <Windows.h>

после чего в HelloMessage.cpp перед return 0; вставляете строку

C++
1
MessageBoxA(NULL, "Hello world!", "Greeting", MB_OK);

запускаете, наблюдаете вот такую картинку
Название: hello.png
Просмотров: 2355

Размер: 2.5 Кб

Содержание

  1. fatal error C1083: Cannot open include file: ‘windows.h’: No such file or directory
  2. windows.h no such file or directory (compile c code on linux) [closed]
  3. 1 Answer 1
  4. «Cannot open include file: ‘config-win.h’: No such file or directory» while installing mysql-python
  5. 22 Answers 22
  6. Thread: windows.h no such file or directory
  7. windows.h no such file or directory

fatal error C1083: Cannot open include file: ‘windows.h’: No such file or directory

Помощь в написании контрольных, курсовых и дипломных работ здесь.

Ошибка fatal error C1083: Cannot open include file: ***: No such file or directory
Помогите пожалуйста исправить ошибку. При компиляции возникает вот такая беда. подробности в.

tickFatal error C1083: Не удается открыть файл include: iostream.h: No such file or directory
Ругается и все, Подскажите,что делать? Ошибка 1 fatal error C1083: Не удается открыть файл.

наскоко мне память не изменяет Visul C++ 2005 Express Editional это не полная версия просто в ней отсутствует инклуд windows.h

Добавлено через 2 минуты
для полной разработки приложений тебе надо Visul C++ 2005 Profissional Editional

Fatal error C1083: Не удается открыть файл include: afxwin.h: No such file or directory
Помогите установить VC++ 2008. Что делать при этой ошибке: Ошибка 1 fatal error C1083: Не удается.

tickОшибка «Fatal error C1083: Не удается открыть файл include: stdafx.h: No such file or directory»
Здравствуйте, помогите пожалуйста во многих лабораторных работах выдаёт ошибку «fatal error C1083.

Источник

windows.h no such file or directory (compile c code on linux) [closed]

Want to improve this question? Update the question so it’s on-topic for Stack Overflow.

main.c:2:10: fatal error windows.h: No such file or directory compilation terminated

Do you have any idea why this error happens and how to fix?

2b4pE

1 Answer 1

The problem is that your code is using the windows.h header file to get function declarations for Windows-only functions. This file does not normally exist on Linux, because its installations of toolchains (such as GCC) will (by default) only include the files needed to compile for Linux.

You have a few options:

As Ed Heal suggested, port the code to Linux. That means you would remove the inclusion of windows.h, and replace all the function calls that used the Windows API with their Linux equivalents. This will make your source code only work on Linux, unless you can refactor the OS-dependent calls into platform-agnostic code. A word of warning: unless the program you’re working with is trivial, this is not an easy task. There’s no guarantee that every Windows API function has a Linux equivalent.

Install a Windows toolchain for your build system, which should include windows.h, and cross-compile your code. This will result in a binary that won’t work on Linux, but will work on Windows.

A middle ground between those two options would be to actually do both, and use conditional compilation to allow you to selectively compile for one target or another.

Источник

«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

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.

npebi

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.

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 FilesMySQLConnector C 6.0.2include

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:

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.

Источник

Thread: windows.h no such file or directory

Thread Tools
Search Thread
Display

windows.h no such file or directory

I am working on getting a new compiler and the one im looking at is MVC(not sure if the ++ are included on the end lol). Anyways, my current compiler is Dev 4.9.2 and it compiles and runs my program just fine. But when I moved the code over to the MVC and tried it, it didnt work. I got the same error multiple times. So then I downloaded Platform SDK and added in the lib,bin and include files I was supposed to. I also changed a line of code that had kerbel.lib or something like that on it(which I was supposed to do). And I still cant get it to work.

here is the error message:

This is how I used it in the actual code:

I tried changing windows.h to windows and that didnt work either. So im nnot really sure wat else to do. If someone could explain to me why it doesnt work and/or how to fix it that would be great.

progress

progress

I didn’t see step 5 the first time through(I was in a hurry and didnt scroll down that far). Anyways, I commented out the for lines that it says t comment out. Then it says:

I did exactly what it said but cant finish it because I cant make a windows app. And I have no idea why I cant.

progress

If you were in a hurry then, double check now if you have the needed paths on the include list.

progress

Well, I’m glad you said that mario. I did add the paths I was supposed to add, but I added all 3 of them into the executables. I fixed that part. But I still got the error when I ran my program, and I still cant make a windows app. I still can only make a console app.

I also just noticed another thing. On the page Ancient Dragon pointed out says to comment out lines 441-444

in C:Program FilesMicrosoft Visual Studio 8VCVCWizardsAppWizGenericApplicationhtml103 3. I went there, opened the file in Notepad(it mentioned opening it in a text editor) and looked for the 4 lines. Well, I only found these 3 lines.

So, should I just replace the 3 lines I have with the 4 lines it says should be commented out. Or could this really screw up the program?

EDIT: Ok cool. I found the 4 lines. I didnt notice them the first few searches. But I just found them and commented them out. Its working a’ok now.

RE-EDIT!: Bah! Ok, I thought it was working but unfortunately it isnt. I can now make windows apps and dll’s. Yet it still says that there is no winows.h. I just dont get it, ive done all the install steps. All the other headers work just fine. I dont know what else to do from here. It works just fine in Dev C++. Is there some stupidly obvious lib im supposed to add or something?

Источник

Понравилась статья? Поделить с друзьями:
  • Fatal error a1000 cannot open file windows inc
  • Fat32format скачать на русском для windows 10 торрент
  • Fat32format не запускается на windows 10
  • Fat32 или ntfs при установке windows 10 на ssd
  • Fat32 или ntfs для загрузочной флешки windows 10 64 bit