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 starte
If you already haven't done it, try adding "SDK Path\Include"
to:
Project → Preferences → C/C++ → General → Additional Include Directories
And add "SDK Path\Lib"
to:
Project → Preferences → Linker → General → Additional Library Directories
Also, try to change "Windows.h"
to <windows.h>
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.
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.
You should see:
$(WindowsSdkDir)\include
If this is missing, you found a problem. If not, search for a file. It should be located in
32 bit systems:
C:\Program Files\Microsoft SDKs\Windows\v6.0A\Include
64 bit systems:
C:\Program Files (x86)\Microsoft SDKs\Windows\v6.0A\Include
if VS was installed in the default directory.
Source: http://forums.codeguru.com/showthread.php?465935-quot-windows-h-no-such-file-or-directory-quot-in-Visual-Studio-2008!-Help&p=1786039#post1786039
1) Go to C:\Program Files (x86)\Microsoft SDKs\Windows\v7.1A for VS2013
2) Copy the folders Include
and Lib
(you should check where are your folders in folder windows such as v7.1
, v8
, v6
, etc.)
3) Paste them into C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC
I solved my problems like:
error lnk1104: cannot open file 'kernel32.lib'.
error c1083: Cannot open Windows.h
Thanks.
I got this error fatal error lnk1104: cannot open file 'kernel32.lib'. this error is getting because there is no path in VC++ directories. To solve this problem
Open Visual Studio 2008
In my case It is C:\Program Files\Microsoft SDKs\Windows\v6.0A\Lib
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.
Check which Windows SDK version is specified in your project's Platform Toolset. (Project → Properties → Configuration Properties → General
). If your Toolset ends in _xp
, you'll need to install XP support.
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.
The right combination of Windows SDK Version and Platform Toolset needs to be selected Depends of course what toolset you have currently installed