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

I am learning Kinect development using C++ in Visual Studio 2013 (Desktop version on Windows 8.1). I have downloaded the Kinect SDK 2.0 from Microsoft. According to my understanding, NuiApi.h is part of Kinect SDK 2.0. However, I cannot include it (#include says Cannot open source file). Have searched my computer for the file but couldn't find it. Reinstalled Kinect SDK with no luck. Below is the related part of the code:
#include<iostream>
#include<Windows.h>
#include<kinect.h>
#include<NuiApi.h>
A similar header, NuiKinectFusionApi.h, can be included without a problem.

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

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 :)

Related

C++ Compiling Linking

I am currently getting into some DirectX Programming and just installed the DX-SDK. However, when I open the most basic sample File (Tutorial01, just displays a blue background) in Visual Studio (2012, but that seems to be irrelevant) and compile it I get a working output.
When I start an empty c++ project, make a new file called main.cpp and copy and paste the code from the tutorial, do the same with the resource.h file and also go to Project settings->Configuration Properties->Linker and copy the "Input" from the sample to my own project and then compile my project I get the following error output:
fatal error C1083: Cannot open include file: 'd3dx11.h': No such file or directory
The Header is included via #includein both, the sample and my project. However my project won't compile.
Your new project is missing VC++ Directories settings to find the DirectX SDK include/lib paths. Starting with VS 2010, you have to explicitly set up the include/lib paths to get the DirectX SDK integrated with Visual Studio.
Since you are trying to use VS 2012 with the legacy DirectX SDK, you should be aware that the VC++ Directories settings for VS 2010 are backwards from what you should be using with VS 2012/VS2013. This is because the Windows 8.x SDK includes newer versions of most of the DirectX headers in the now outdated and deprecated legacy DirectX SDK.
The further complication is that D3DX is not present in the Windows 8.x SDK and is itself deprecated. You can make it work per the instructions on MSDN, but keep in mind there are now alternatives to using D3DX for Direct3D 11 you should consider.

Intel OpenCL SDK - where are the header files?

I'm trying to use OpenCL on my ultrabook with Iris graphics, therefore I've installed the Intel OpenCL SDK 2013 (the one from here: http://software.intel.com/en-us/vcsource/tools/opencl-sdk).
Trying to do something with it, however I fail to find the directory where the header file (CL/cl.h) is stored... there's no include subdirectory in the install location, and also no headers in the Visual Studio / SDK folders... a search for cl.h on my C: drive also didn't give any results.
What am I doing wrong? Do I have to install anything else to get the headers?
I've only used the AMD OpenCL SDK before, there the headers are neatly located in an include subdirectory of the installation folder...
Turns out the installer didn't run through properly. The last page looked inconspicous and had a nice Finish button, but only the Runtime got installed, but not the Application SDK. The Installer says something like "Installation ended prematurely because of an error" (no more specific information as to what error it was that had occured).
The reason is that the Installer doesn't seem to like my Visual C++ 2010 Express Edition.
Deactivating the "Visual Studio (2010) integration" made the installation be successful, and made the includes turn up.
For me, it's under:
C:\Program Files (x86)\Intel\OpenCL SDK\<version>\include\CL\cl.h
Are you sure the installation was completed successfully? Do you have a bin folder under the OpenCL SDK folder?
For the current version of the SDK, it is at:
C:\Program Files (x86)\IntelSWTools\system_studio_2020\OpenCL\sdk\include
As installed by intel_sdk_for_opencl_applications_2020.3.494.zip downloaded from https://software.intel.com/content/www/us/en/develop/tools/opencl-sdk.html

Visual Studio 2010 can't find iostream

I just installed Visual Studio 2010, and wanted to test it out by writing a hello world application.
#include <iostream>
using namespace std;
int main()
{
cout << "Hello World!" << endl;
return 0;
}
After trying to compile this I get this error
error C1083: Cannot open include file: 'iostream': No such file or directory
Here are my visual studio include directories
$(VCInstallDir)include; $(VCInstallDir)atlmfc\include; $(WindowsSdkDir)include; $(FrameworkSDKDir)\include;
And my library directories
$(VCInstallDir)lib;$(VCInstallDir)atlmfc\lib;$(WindowsSdkDir)lib;$(FrameworkSDKDir)\lib
If you are unable to build a simple hello world application then it suggests that either Visual Studio or the Windows SDK isn't installed correctly. Have you downloaded and installed the Windows SDK? (note: if you need to build for XP you might need to use the Win7 SDK instead)
I seem to recall that after installing the Windows SDK you may need to 'integrate' it for use with VS2010. Each version of Visual Studio can have a different default SDK that it builds against. You may need to run the SDK Configuration Tool to register it for use with VS2010. Alternatively, you might need to check the 'Platform Toolset' settings in the project, as described here
Ultimately, once that is correctly setup then you should be able to build simple C++ apps without any further configuration.
The pages given below may help you:
1.) http://msdn.microsoft.com/en-us/library/8z9z0bx6.aspx
2.) http://msdn.microsoft.com/en-US/library/hdkef6tk.aspx
<iostream> is normally stored in the C:\Program Files\Microsoft Visual Studio 10\VC\include folder. First check if it is still there.
the /P compiler option is uese to preprocess helloWorld.cpp(say),this will generate helloWorld.i, and then you check to see where iostream is getting included.
and the builded log should be helpful as well as using the /showincludes option to show the paths to the include files.
Go through the normal easy process of creating a new Project --> Templates: Visual C++ --> Win32 Console Application. If not, search your HDD for iostream and set the include path manually.

How to get started with directshow?

I'm having a great trouble trying to understand this,
what's the least set up to compile/run directshow apps?
I've already installed visual c++ 2008 express.
A hello world will be nice,
RGS!
Setting up Your Environment
Setting up the environment is a cumbersome process, since DirectShow has now been buried deep in the Windows 7 SDK. If you don't already have the baseclasses built, which you'lll need to do any DirectShow development, you must first compile the DirectShow baseclasses.
You'll find the baseclasses in the Windows SDK. The latest Windows SDK is v7.1.
You can download the Windows SDK from microsoft's website.
If you install the Windows SDK to it's default folder, you'll find the baseclasses here:
C:\Program Files\Microsoft SDKs\Windows\v7.1\Samples\multimedia\directshow\baseclasses
In that folder, you'll find a Visual Studio solution file. Open that solution in Visual Studio and compile it for both Debug and Release modes.
Next, in Visual Studio, go to the following menu option:
Tools -> Options,
Projects & Solutions -> VC++ Directories
Show directories for -> Include files
Add this:
C:\Program Files\Microsoft SDKs\Windows\v7.1\Samples\multimedia\directshow\baseclasses
Show directories for -> Library files
Add these:
C:\Program Files\Microsoft SDKs\Windows\v7.1\Samples\multimedia\directshow\baseclasses\Debug
C:\Program Files\Microsoft SDKs\Windows\v7.1\Samples\multimedia\directshow\baseclasses\Release
You should now be all set to build DirectShow programs. You may also want to add extra libraries like the DirectX libraries, (which you'll need if you're doing more advanced rendering with VMR9) and the WMFSDK (if you're working with Windows Media Format stuff).
Writing a Hello World program is a little long for pasting into Stack Overflow. I'll have a look at posting one sometime this weekend, but you might like to check out CodeProject in the meantime, which is bound to have oodles of DirectShow examples.
DirectShow has an active community of developers, where you can discuss problems and solutions.
Good luck!
Try downloading SDK such as Windows SDK "http://www.microsoft.com/downloads/details.aspx?FamilyID=6b6c21d2-2006-4afa-9702-529fa782d63b&displaylang=en".
There are usually a bunch of samples for directshow. But, mainly they either use commandline "nmake" (not make) or "cl" (not cc or gcc) to build. Sometimes they provide *.sln files to be used under VS.
Your vcam package is only a dll and you still need to write an application to test this.
Based on the samples from there, I believe you can be able to cook up one hello-world app for your vcam ;)
To get the vcam example, you basically have to create a fresh new "dll" project in VC 2010, add the old files into it, then setup the .def file to export all the methods you need.
Here's some links for ya:
http://betterlogic.com/roger/?p=3096
To make it easier on ya, I add a "visual studio express 2010 project" to the vcam_vs_2010 folder of
http://github.com/rdp/directshow-demo-audio-input-source
(checkout its README.txt)
GL.
-r

'dxerr9.h': No such file or directory

I am trying to compile a program I took off a cd from a book that uses directx to render 3d objects. when i press compile I get the following error
C1083: Cannot open include file: 'dxerr9.h': No such file or directory
I am using VC++ 2008 Express Edition and i am running off of Vista. I went to the following folder
[edit]
C:\Program Files (x86)\Microsoft DirectX SDK (February 2010)\Include
I was able to find dxerr.h in the folder and the path is also being included in the VC++ Directories tab in the options window. dont know whats going on.
It seems your program was written using older version of DirectX SDK. The 'dxerr9.h' is present at least in "Microsoft DirectX 9.0 SDK (December 2004)", but is absent at least in "Microsoft DirectX SDK (August 2009)".
I think VitalyVal was right. about the following:
It seems your program was written using an older version of DirectX SDK. The 'dxerr9.h' is present at least in "Microsoft DirectX 9.0 SDK (December 2004)", but is absent at least in "Microsoft DirectX SDK (August 2009)".
I think the files now go by dxerr.h. I removed the 9 to the header and lib files and it worked.
That header was precisely duped in Aug2009 SDK, though that shouldn't surprise since it was already two years older DX versions had been deprecated, thus allowing for just a single library for everything.
By the way, people might be interested to check this post for a kind of more updated version.