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:
Error 5 error RC1015: cannot open include file 'windows.h'. C:\temp\ColorBasics-D2D\ColorBasics.rc 17 1 ColorBasics-D2D
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):
//------------------------------------------------------------------------------
// <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\0"
END
2 TEXTINCLUDE
BEGIN
"#define APSTUDIO_HIDDEN_SYMBOLS\r\n"
"#include ""windows.h""\r\n"
"#undef APSTUDIO_HIDDEN_SYMBOLS\r\n"
"\0"
END
3 TEXTINCLUDE
BEGIN
"\r\n"
"\0"
END
#endif // APSTUDIO_INVOKED
#endif // English (United States) resources
/////////////////////////////////////////////////////////////////////////////
#ifndef APSTUDIO_INVOKED
/////////////////////////////////////////////////////////////////////////////
//
// Generated from the TEXTINCLUDE 3 resource.
//
/////////////////////////////////////////////////////////////////////////////
#endif // not APSTUDIO_INVOKED
I’m trying to get IKVM to build (see this question) but now have encountered a problem not having to do with IKVM so I’m opening up a new question:
When running nant on the IKVM directory with the Visual Studio 2008 Command Prompt (from the Start Menu), I get the following error:
ikvm-native-win32: [cl] Compiling 2 files to C:\ikvm-0.36.0.11\native\Release'. [cl] jni.c [cl] os.c [cl] C:\ikvm-0.36.0.11\native\os.c(25) : fatal error C1083: Cannot open include file: 'windows.h': No such file or directory [cl] Generating Code... BUILD FAILED C:\ikvm-0.36.0.11\native\native.build(17,10): External Program Failed: cl (return code was 2)
I have the Platform SDK installed. What am I missing? I’m sure it’s something simple…
Edit #1 I just checked — I do have the directory containing windows.h on the Path.
Edit #2 Found the answer (see my answer below): The directory containing windows.h needed to be in the «Include» path variable.
15 / 15 / 2 Регистрация: 26.04.2012 Сообщений: 1,091 |
|
1 |
|
04.02.2014, 17:29. Показов 28461. Ответов 13
Ошибка 1 error C1083: Не удается открыть файл включение: Zagolovotsnyj_loaded_ library.h: No such file or directory d:\прога2014\прогапроба\reshenie_loaded_ library\dlltest\dlltest.cpp 6 1 DLLtest Прокоментируйте пожалуста. Миниатюры
0 |
3255 / 2057 / 351 Регистрация: 24.11.2012 Сообщений: 4,909 |
|
04.02.2014, 17:41 |
2 |
Файл находится в другом проекте и в другом каталоге. Чтобы он был виден, поправьте настройки проекта (пути к заголовочным файлам)
1 |
15 / 15 / 2 Регистрация: 26.04.2012 Сообщений: 1,091 |
|
04.02.2014, 19:07 [ТС] |
3 |
Свойства -> Конфигурация Свойства -> C / C + + -> Общие -> Дополнительные каталоги включения -> $(ProjectDir)\D:\Прога2014\Прогапроба\Reshenie_loaded_ library\Debug\loaded_ library.dll Как ему указать еще? Может я что-то лишнеевписал или наоборот не вписал?
0 |
3255 / 2057 / 351 Регистрация: 24.11.2012 Сообщений: 4,909 |
|
04.02.2014, 19:11 |
4 |
Указать нужно каталог с исходниками, а вы пишете полный путь до dll.
1 |
15 / 15 / 2 Регистрация: 26.04.2012 Сообщений: 1,091 |
|
04.02.2014, 20:05 [ТС] |
5 |
А можете написать, где это в моем случае?
0 |
3255 / 2057 / 351 Регистрация: 24.11.2012 Сообщений: 4,909 |
|
04.02.2014, 20:09 |
6 |
У меня даже винды нет, чтобы проверить какая структура у проектов. Ну судя по тому, что вижу, путь к солюшену должен быть такой:
1 |
Dimka-novitsek 15 / 15 / 2 Регистрация: 26.04.2012 Сообщений: 1,091 |
||||
04.02.2014, 21:19 [ТС] |
7 |
|||
Может конечно я опять что-то напутал
Не выходит Добавлено через 1 минуту
0 |
3255 / 2057 / 351 Регистрация: 24.11.2012 Сообщений: 4,909 |
|
04.02.2014, 21:21 |
8 |
Какие-то пробелы лишние образовались.
1 |
15 / 15 / 2 Регистрация: 26.04.2012 Сообщений: 1,091 |
|
04.02.2014, 21:35 [ТС] |
9 |
хм!! Спасибо!! Я же его мышью скопировал, из относительного пути. Щас разберусь!!! Добавлено через 5 минут Добавлено через 3 минуты Добавлено через 25 секунд Миниатюры
0 |
15 / 15 / 2 Регистрация: 26.04.2012 Сообщений: 1,091 |
|
05.02.2014, 00:44 [ТС] |
10 |
Вот
0 |
3255 / 2057 / 351 Регистрация: 24.11.2012 Сообщений: 4,909 |
|
05.02.2014, 06:41 |
11 |
В названиях каталога, солюшна и проекта пробелы… Просмотрите еще раз все внимательно.
1 |
15 / 15 / 2 Регистрация: 26.04.2012 Сообщений: 1,091 |
|
05.02.2014, 11:03 [ТС] |
12 |
Доброго утра!!Да я это видел. Пробел- это не ошибка. Я уже проект с пробелами не трогаю, а то будет тема как вернуть проект после переименования файлов.cpp b/h. Шучу конечно. Проект можно переписать минут за 20. Но пробел-не ошибка.
0 |
0x10 3255 / 2057 / 351 Регистрация: 24.11.2012 Сообщений: 4,909 |
||||
05.02.2014, 11:29 |
13 |
|||
Пробел- это не ошибка Нет, но поскольку он мало заметен, может стать причиной. Некоторые вещи просто нельзя пропускать в проект. В частности спецсимволы в именах файлов. Не говорю уже о транслите.
Ну вот что это за кривой путь.
1 |
15 / 15 / 2 Регистрация: 26.04.2012 Сообщений: 1,091 |
|
06.02.2014, 18:13 [ТС] |
14 |
Спасибо. Решение Свойства -> Конфигурация Свойства -> C / C + + -> Общие -> Дополнительные каталоги включения -> D:\Прога2014\Прогапроба\Reshenie_lo aded_ library\Debug\loaded_ library.dll $(SolutionDir)\loaded_ library
0 |
I’m trying to get IKVM to build (see this question) but now have encountered a problem not having to do with IKVM so I’m opening up a new question:
When running nant on the IKVM directory with the Visual Studio 2008 Command Prompt (from the Start Menu), I get the following error:
ikvm-native-win32: [cl] Compiling 2 files to C:\ikvm-0.36.0.11\native\Release'. [cl] jni.c [cl] os.c [cl] C:\ikvm-0.36.0.11\native\os.c(25) : fatal error C1083: Cannot open include file: 'windows.h': No such file or directory [cl] Generating Code... BUILD FAILED C:\ikvm-0.36.0.11\native\native.build(17,10): External Program Failed: cl (return code was 2)
I have the Platform SDK installed. What am I missing? I’m sure it’s something simple…
Edit #1 I just checked — I do have the directory containing windows.h on the Path.
Edit #2 Found the answer (see my answer below): The directory containing windows.h needed to be in the «Include» path variable.
asked Sep 17, 2008 at 7:25
1
OK here is the answer I ended up finding: rather than being on the Path, the directory with windows.h (in my case, C:\Program Files\Microsoft SDKs\Windows\v6.0A\Include) needed to be set in the Include environment variable.
answered Sep 17, 2008 at 8:48
EpagaEpaga
37k58 gold badges154 silver badges243 bronze badges
3
By the way, create environment variable %LIB%, meaning the same — path to all SDKs lib directories
answered Jan 15, 2009 at 13:08
abatishchevabatishchev
95.4k80 gold badges293 silver badges426 bronze badges
Not the answer you’re looking for? Browse other questions tagged c# .net path ikvm or ask your own question.
Solution 1
OK here is the answer I ended up finding: rather than being on the Path, the directory with windows.h (in my case, C:\Program Files\Microsoft SDKs\Windows\v6.0A\Include) needed to be set in the Include environment variable.
Solution 2
By the way, create environment variable %LIB%, meaning the same — path to all SDKs lib directories
Related videos on Youtube
06 : 43
Sữa lỗi No such file or Directory trên Arduino IDE / How to fix errors: No such file or Directory
11 : 24
2 Easy fixes to Arduino error: “.h: No such file or directory»
Programming Electronics Academy
00 : 37
Fatal Error iostream No such file or directory [Solved]
03 : 39
How to fix «Error C1083 Cannot open include file: ‘correct.h’: no such file or directory» | 4Fun4You
05 : 11
Visual Studio fatal error C1083: Cannot open include file
01 : 23
Running Cython in Windows x64 — fatal error C1083 Cannot open include file basetsd.h No such file o
05 : 41
Error arduino: No such file or directory.
03 : 14
Sửa lỗi không tìm thấy file hoặc director (Fix error No Such File or Directory)
Comments
-
I’m trying to get IKVM to build (see this question) but now have encountered a problem not having to do with IKVM so I’m opening up a new question:
When running nant on the IKVM directory with the Visual Studio 2008 Command Prompt (from the Start Menu), I get the following error:
ikvm-native-win32: [cl] Compiling 2 files to C:\ikvm-0.36.0.11\native\Release'. [cl] jni.c [cl] os.c [cl] C:\ikvm-0.36.0.11\native\os.c(25) : fatal error C1083: Cannot open include file: 'windows.h': No such file or directory [cl] Generating Code... BUILD FAILED C:\ikvm-0.36.0.11\native\native.build(17,10): External Program Failed: cl (return code was 2)
I have the Platform SDK installed. What am I missing? I’m sure it’s something simple…
Edit #1 I just checked — I do have the directory containing windows.h on the Path.
Edit #2 Found the answer (see my answer below): The directory containing windows.h needed to be in the «Include» path variable. -
So, you have to set the value of the «Include» path variable to «C:\Program Files (x86)\Microsoft SDKs\Windows\v6.0A\Include». If it did not exist you created the «Include» environment variable and set the value to that specified in your answer?
-
I’m genuinely asking and also think for prosperity that it is worth being explicit here.
-
@JohnDoe — just tried it, some of the Windows SDK’s have build command prompts, if you open one and type
SET
, you will see all environment variables, among othersInclude=
… which is verbatim as such.