Reputation: 259
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:
Upvotes: 1
Views: 3276
Reputation: 920
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/
Upvotes: 1
Reputation: 259
I found the folder here:
C:\Program Files (x86)\OpenNI2\Samples\Bin
and copied it to my directory, which worked perfectly.
Upvotes: 2