elliotwoods / ofxKinectForWindows2

Implementation of Kinect For Windows v2 API (not using KinectCommonBridge)
163 stars 70 forks source link

Qtcreator KinectForWindows2 Kinect.h No such file or directory compile error #86

Closed lenbang closed 3 years ago

lenbang commented 6 years ago

Hey there, I’m new to openFrameworks

I have it installed in E:/of/openFrameworks and examples I’ve tested that came with it work perfectly!

I pasted the addon into addons/ofxKinectForWindows2 and now can’t get any examples to work. I pasted them into openFrameworks/examples/ofxKinectForWindows2, and tried to add them to qtcreator as File > New Project, then “Import existing oF Application…”

Then I can uncomment the section

     of.addons: [
         'ofxGui',
         'ofxOpenCv',
         'ofxKinectForWindows2', //**and add this line, which fixed missing "ofxKinectForWindows2.h"
     ]

But when I go to build, it cannot find the “Kinect.h” file - No such file or directory. I have read the comments, and the readme: Yes, I do have the latest version of Kinect for Windows SDK installed, and yes, I have restarted. It is located just where the library install guide screenshot indicates:

“C:\Program Files\Microsoft SDKs\Kinect\v2.0_1409\inc” And yes, it is system variable “KINECTSDK20_DIR” on my machine

Looking at the guide for Visual Studio, it says to

Try the examples to see if they build and run. Then try with your own project:

Make your project with Project Generator, but do not select ofxKinectForWindows2 as an addon at this stage Open the solution, and add the ofxKinectForWindows2Lib.vcxproj to your solution (right click on the Solution and choose Add > Existing Project... ) In Property Manager (open it from View -> Other Windows -> Property Manager ), right click on your project to select Add Existing Property Sheet... and select the ofxKinectForWindows2.props file. Go back to Solution Explorer , right click on your project (e.g. ‘mySketch’) and select ‘Add Reference…’, and add a reference to ofxKinectForWindows2Lib

How do I do this in qtcreator? How to I get the right references or property sheet or whatever to find the kinect sdk? Do I have to edit the “addon_config.mk”?

elliotwoods commented 6 years ago

I’m not familiar with qtcreator If you check the settings in this props file you can see the include paths you need https://github.com/elliotwoods/ofxKinectForWindows2/blob/master/ofxKinectForWindows2.props

If it doesn’t work, I’d add the Kinect SDK include directory manually in your project (Bare absolute path, without the system macro)