1

I am trying to get a C++ example to work which uses the OpenNI library for Kinect. I have setup my library as in the correct answer given here for a 32-bit version:

OpenNI 2 and Visual Studio 2012

However as soon as the code executes:

rc = OpenNI::initialize();
if (rc != openni::STATUS_OK)
    throw runtime_error(string("Could not initialize OpenNI: ") +   string(OpenNI::getExtendedError()));

I get the error:

   Could not initialize OpenNI: Found no files matching (project path) OpenNI2\\Drivers\\*.dll'\n"  const char *

The directory OpenNI2\Drivers\ does not exist, and should not in the project (vs2012) folder as far as I am aware?

I have no idea why it would be looking in the project path at all? The kinect divers are installed and openni is downloaded from:

http://structure.io/openni

Community
  • 1
  • 1
user3319320
  • 229
  • 1
  • 3
  • 11

2 Answers2

2

I found the folder here:

     C:\Program Files (x86)\OpenNI2\Samples\Bin

and copied it to my directory, which worked perfectly.

user3319320
  • 229
  • 1
  • 3
  • 11
1

Install OpenNI2 from this link: https://structure.io/openni

Add this path as a Environment variable C:\Program Files\OpenNI2\Samples\Bin

If you don't know how to add path as a variable follow the instruction of this link https://www.architectryan.com/2018/03/17/add-to-the-path-on-windows-10/

Joy Mazumder
  • 870
  • 1
  • 8
  • 14