简体   繁体   中英

Using the Kinect from Qt Creator

I have a machine running with windows 8.1, the kinect 2.0 for windows (and its SDK), visual studio community, and Qt Creator installed. Right now I am trying to create a small app that pulls the joint data from the kinect and then outputs it in a text form on a GUI created in Qt Creator.

I have the microsoft examples for using the kinect in visual studio, but for creating and using GUI's I would prefer to use Qt Creator as it is what I use for all of my other projects.

My .pro file has the lines:

HEADERS += \
    ../../../../Program Files/Microsoft SDKs/Kinect/v2.0_1409/inc/Kinect.h \

and

win32: LIBS += -L$$PWD/../../../../Program Files/Microsoft SDKs/Kinect/v2.0_1409/Lib/x64 -lKinect20
INCLUDEPATH += -L$$PWD/../../../../Program Files/Microsoft SDKs/Kinect/v2.0_1409/Lib/x64
DEPENDPATH += -L$$PWD/../../../../Program Files/Microsoft SDKs/Kinect/v2.0_1409/Lib/x64

This gives me the error:

LNK1104: cannot open file 'Files/Microsoft.obj'

what else do I need to be including to get this to work?

you just need to make some changes in the .pro file.

As the include path and the library files path contains spaces in it, Please use " " (double quotes) to skip/escape the spaces. The error you are getting would go with this.

Also remove -L$$PWD/../../../../ from the path and remove -l from -lkinect20 and add kinect20.lib instead.

Just look at my .pro file and make changes accordingly

win32:CONFIG(release, debug|release): LIBS += "C:/Program Files/Microsoft SDKs/Kinect/v2.0_1409/Lib/x86/Kinect20.lib"

else:win32:CONFIG(debug, debug|release): LIBS += "C:/Program Files/Microsoft SDKs/Kinect/v2.0_1409/Lib/x86/Kinect20d.lib"

else:unix: LIBS += "C:/Program Files/Microsoft SDKs/Kinect/v2.0_1409/Lib/x86/lKinect20.lib"

INCLUDEPATH += "C:/Program Files/Microsoft SDKs/Kinect/v2.0_1409/inc"

DEPENDPATH += "C:/Program Files/Microsoft SDKs/Kinect/v2.0_1409/inc"

And i'm running my code in the release mode. Good to go.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM