Visual Studio 2013 and Kinect SDK 2.0 Cannot find or include <NuiApi.h>

十年热恋 提交于 2019-12-04 16:18:47

You are mixing the 2 kinect versions!

for the kinect v1, you need to download kinect v1.8 drivers and then use the NuiApi.h

for the kinect v2, you need to download kinect v2.0 drivers and then use the kinect.h

Adarsh Vardhan

You need to follow these steps to include #include.

1)Include windows.h in your source code.

2)To use the NUI API, include MSR_NuiApi.h. Location: Program Files\Microsoft Research KinectSDK\inc To do this, you probably want to add that path to your project

Right-click on your project, properties, VC++ directories

Add ;C:\Program Files\Microsoft Research KinectSDK\inc to the end of the include paths
Add ;C:\Program Files\Microsoft Research KinectSDK\lib to the end of the libraries paths

then add #include <MSR_NuiApi.h> to the includes at top of your source file. If you're using precompiled headers then you should put it below the stdafx.h include, or just add it to stdafx.h instead.

3) To use the Kinect Audio API, include MSRKinectAudio.h. Location: Program Files\Microsoft Research KinectSDK\inc

4)Link to MSRKinectNUI.lib. Location: Program Files\Microsoft Research KinectSDK\lib

5.Ensure that the beta SDK DLLs are on your path when you run your project. Location: \Program Files\Microsoft Research KinectSDK This means that your binary needs to be able to find these files at runtime.

The easiest way to do this is to add them to your system path; go to

start menu right-click computer, properties advanced system settings environment variables PATH, in your user or system settings - edit and append ; then the path given You may then need to restart Visual Studio to pick this up, or it should be registered when you open a new command prompt.

Or, if you don't want to change the system settings, you can e.g. add it to an open command prompt with

PATH=%PATH%;C:\Program Files\Microsoft Research KinectSDK

or you can work out exactly which files there are necessary and copy them into the same directory as your binary, etc.

Source : Getting the Kinect SDK to work with visual studio 2010 in c++

Hope that helps :)

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!