Building and running a sample application

This step is needed to ensure that OpenNI was installed properly, and that the development environment is properly set up to enable you to build OpenNI-based applications.

To build and run a sample application:

1. Make sure you have the latest Microsoft Platform SDK installed (You can currently download this via the following hyperlink: Microsoft's Platform SDK Web Install).
2. Open Windows Explorer (or your favorite file navigator), and browse to OpenNI installation directory (default: C:\Program Files\OpenNI)
3. In OpenNI directory browse to: Samples\NiSimpleViewer.
4. Open the suitable project file, NiSimpleViewer.vcxproj, and build the application. If the build fails, contact PrimeSense support.
5. After successfully building the project, before trying to run it, please ensure that the SamplesConfig.xml file is correctly configured:
   1. Browse to the 'Data' directory (the default location of this directory is C:\Program Files\OpenNI\Data).
   2. Open the SamplesConfig.xml for editing using a text editor (additional information can under Xml Scripts).

Note
  Throughout the sample applications tutorial you will encounter use of relative paths in the sample application source files. Note that when your application is executed from within a debugging environment such as Microsoft Visual Studio, paths which are not absolute may not be resolved relatively to the output executable.
  Therefore, in order for the sample application to execute correctly in Debug mode, you should modify the Working Directory to be the sub-folder into which the executable is located. You can also use Visual Studio's macro $(TargetDir) instead of setting an actual path.
  Use "Project Properties"->"Debugging"->"Working Directory" to set the value.