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.9k11 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,3915 gold badges35 silver badges47 bronze badges

answered Feb 1, 2019 at 5:22

Pekka Kalevi Ylönen's user avatar

RRS feed

  • Remove From My Forums
  • Общие обсуждения

  • Всем привет. Я установил ВС 2015 и при попытке компиляции проекста получаю windows.h: No such file or директорий. В 2013 студии все работало отлично. Что делать ? Мне нужны функции из windows.h.

    Hello. I installed
    VS 2015 and while trying to compile
    proeksta
    get windows.h: No such file or directory.
    In 2013 the studio everything worked
    perfectly.
    What to do? I need a function from
    windows.h

Все ответы

  • Какой тип проекта создаете? На каком языке? Как создаете проект? Подробно, по шагам.


    Если сообщение помогло Вам, пожалуйста, не забудьте отметить его как ответ данной темы. Удачи в программировании!

  • Спасибо за ответ, напишу сейчас все подробно. Просто первый раз тут. Создаю консольное приложение C++ , файл, создать проект, консольное приложение..готово.  Полазил по директория включение и не нашел там windows.h, что странно. Вот код,
    если нужно, но там все стандартно.
    #include «stdafx.h»
    #include «windows.h»

    int _tmain(int argc, _TCHAR* argv[])
    {
        return 0;
    }

    Стоят 2 версии студии, 13 и 15, в 13 все отлично.

  •  Полазил по директория включение и не нашел там windows.h, что странно.

    Какие именно каталоги Вы смотрели? windows.h должен находиться в каталогах включения Windows SDK, а не Visual Studio. Посмотрите также, что у Вас написано в свойствах проекта по поводу каталогов включения:

    Если там что-то другое, значит студия «криво» встала, либо испорчены свойства проекта данного типа по умолчанию.


    Если сообщение помогло Вам, пожалуйста, не забудьте отметить его как ответ данной темы. Удачи в программировании!

  • Я, к сожалению не могу вставлять сслыки и скриншоты просто так.

    dropbox.com/s/sdg8pd0tqg1zmtz/%D0%A1%D0%BA%D1%80%D0%B8%D0%BD%D1%88%D0%BE%D1%82%202015-05-23%2018.49.34.png?dl=0

  • А если свою папку убрать из списка каталогов? Меня смущает наличие в нем символа &.


    Если сообщение помогло Вам, пожалуйста, не забудьте отметить его как ответ данной темы. Удачи в программировании!

  • Нет, к сожалению это не помогло.

  • Посмотрите еще эту настройку. Что будет, если выбрать другой набор инструментов?


    Если сообщение помогло Вам, пожалуйста, не забудьте отметить его как ответ данной темы. Удачи в программировании!

  • Выбрал инструменты от 2013 и проблема исчезла. А что это значит, и как заставить работать на 15м наборе ?

  • Это значит, что Windows SDK из комплекта VS2015 не установлен, либо установлен не полностью. Если установка VS прошла без ошибок, такого быть не должно. Попробуйте переставить (или исправить).


    Если сообщение помогло Вам, пожалуйста, не забудьте отметить его как ответ данной темы. Удачи в программировании!

  • переустановил, как и в прошлый раз. Все прошло успешно, а толку 0.

  • Возможно, у Вас «сбились» настройки проектов C++ по умолчанию.

    Закройте студию и загляните в каталог «C:Users<Имя Пользователя>AppDataLocalMicrosoftMSBuildv4.0», удалите все файлы от туда (либо временно переместите в другое место) и запустите студию заново.


    Если сообщение помогло Вам, пожалуйста, не забудьте отметить его как ответ данной темы. Удачи в программировании!

  • Не знаю, что Вам еще посоветовать. У меня этот файл лежит в папке «C:Program Files (x86)Windows Kits8.1Includeum» и данная папка входит в число каталогов включения проекта С++.


    Если сообщение помогло Вам, пожалуйста, не забудьте отметить его как ответ данной темы. Удачи в программировании!

  • У меня он там тоже есть !

    .dropbox.com/s/nsaxybub9m4yhip/%D0%A1%D0%BA%D1%80%D0%B8%D0%BD%D1%88%D0%BE%D1%82%202015-05-27%2010.53.31.png?dl=0

    Только его не видит студия, не смотря на переименование

    из #include <windows.h> в #include <Windows.h>

    Сейчас проверю, входит ли в число каталогов

    • Изменено
      nanshakov
      27 мая 2015 г. 8:02

Содержание

  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?

Источник

Прежде всего: я использую Microsoft Visual Studio 2012

Я разработчик С#/Java, и теперь я пытаюсь выполнить программу для kinect с помощью Microsoft SDK и С++. Поэтому я начал с примера «Основы цвета», и я не могу его скомпилировать.
Сначала ни один из классов не смог найти Windows.h. Поэтому я установил (или повторно установил, я не уверен) SDK Windows, и добавил включенный каталог SDK к включенному «пути» проекта. Затем все проблемы исчезли, за исключением одного:

Error   5   error RC1015: cannot open include file 'windows.h'. C:tempColorBasics-D2DColorBasics.rc  17  1   ColorBasics-D2D

И это ошибка. Нет причин, по которым система может найти его, потому что он используется в нескольких других файлах, только этот файл не может работать с ним. В качестве ссылки весь файл, который прослушивает (ColorBasics.rc):

//------------------------------------------------------------------------------
// <copyright file="ColorBasics-D3D.rc" company="Microsoft">
//     Copyright (c) Microsoft Corporation.  All rights reserved.
// </copyright>
//------------------------------------------------------------------------------

// Microsoft Visual C++ generated resource script.
//
#include "resource.h"

#define APSTUDIO_READONLY_SYMBOLS
/////////////////////////////////////////////////////////////////////////////
//
// Generated from the TEXTINCLUDE 2 resource.
//
#define APSTUDIO_HIDDEN_SYMBOLS
#include "windows.h"
#undef APSTUDIO_HIDDEN_SYMBOLS

/////////////////////////////////////////////////////////////////////////////
#undef APSTUDIO_READONLY_SYMBOLS

/////////////////////////////////////////////////////////////////////////////
// English (United States) resources

#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)
LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US

/////////////////////////////////////////////////////////////////////////////
//
// Icon
//

// Icon with lowest ID value placed first to ensure application icon
// remains consistent on all systems.
IDI_APP                 ICON                    "app.ico"

/////////////////////////////////////////////////////////////////////////////
//
// Dialog
//

IDD_APP DIALOGEX 0, 0, 512, 424
STYLE DS_SETFONT | DS_FIXEDSYS | WS_MINIMIZEBOX | WS_CLIPCHILDREN | WS_CAPTION | WS_SYSMENU
EXSTYLE WS_EX_CONTROLPARENT | WS_EX_APPWINDOW
CAPTION "Color Basics"
CLASS "ColorBasicsAppDlgWndClass"
FONT 8, "MS Shell Dlg", 400, 0, 0x1
BEGIN
    DEFPUSHBUTTON   "Screenshot",IDC_BUTTON_SCREENSHOT,238,391,50,14
    CONTROL         "",IDC_VIDEOVIEW,"Static",SS_BLACKFRAME,0,0,512,384
    LTEXT           "Press 'Screenshot' to save a screenshot to your 'My Pictures' directory.",IDC_STATUS,0,413,511,11,SS_SUNKEN,WS_EX_CLIENTEDGE
END


/////////////////////////////////////////////////////////////////////////////
//
// DESIGNINFO
//

#ifdef APSTUDIO_INVOKED
GUIDELINES DESIGNINFO
BEGIN
    IDD_APP, DIALOG
    BEGIN
    END
END
#endif    // APSTUDIO_INVOKED


#ifdef APSTUDIO_INVOKED
/////////////////////////////////////////////////////////////////////////////
//
// TEXTINCLUDE
//

1 TEXTINCLUDE 
BEGIN
    "resource.h"
END

2 TEXTINCLUDE 
BEGIN
    "#define APSTUDIO_HIDDEN_SYMBOLSrn"
    "#include ""windows.h""rn"
    "#undef APSTUDIO_HIDDEN_SYMBOLSrn"
    ""
END

3 TEXTINCLUDE 
BEGIN
    "rn"
    ""
END

#endif    // APSTUDIO_INVOKED

#endif    // English (United States) resources
/////////////////////////////////////////////////////////////////////////////



#ifndef APSTUDIO_INVOKED
/////////////////////////////////////////////////////////////////////////////
//
// Generated from the TEXTINCLUDE 3 resource.
//


/////////////////////////////////////////////////////////////////////////////
#endif    // not APSTUDIO_INVOKED

Понравилась статья? Поделить с друзьями:
  • Windows get error message
  • Windows ftp error 530
  • Windows found drivers for your device but encountered an error while attempting to install them
  • Windows found driver software for your device but encountered an error
  • Windows fix disk error