简体   繁体   English

使用Qt Creator中的Kinect

[英]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. 我有一台运行Windows 8.1,用于Windows的kinect 2.0(及其SDK),Visual Studio社区和Qt Creator的计算机。 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. 现在,我正在尝试创建一个小的应用程序,该应用程序可以从kinect中提取关节数据,然后在Qt Creator中创建的GUI上以文本形式输出数据。

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. 我有在Visual Studio中使用kinect的Microsoft示例,但是对于创建和使用GUI的示例,我更喜欢使用Qt Creator,因为它是我在所有其他项目中使用的工具。

My .pro file has the lines: 我的.pro文件包含以下几行:

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. 您只需要在.pro文件中进行一些更改。

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. 还要从路径中删除-L $$ PWD /../../../../,并从-lkinect20中删除-l,然后添加kinect20.lib。

Just look at my .pro file and make changes accordingly 只需查看我的.pro文件并进行相应的更改

win32:CONFIG(release, debug|release): LIBS += "C:/Program Files/Microsoft SDKs/Kinect/v2.0_1409/Lib/x86/Kinect20.lib" win32:CONFIG(发行,调试|发行):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:win32:CONFIG(调试,调试|发行):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" else:unix:LIBS + =“ C:/程序文件/ Microsoft SDKs / Kinect / v2.0_1409 / Lib / x86 / lKinect20.lib”

INCLUDEPATH += "C:/Program Files/Microsoft SDKs/Kinect/v2.0_1409/inc" INCLUDEPATH + =“ C:/程序文件/ Microsoft SDKs / Kinect / v2.0_1409 / inc”

DEPENDPATH += "C:/Program Files/Microsoft SDKs/Kinect/v2.0_1409/inc" DEPENDPATH + =“ C:/程序文件/ Microsoft SDKs / Kinect / v2.0_1409 / inc”

And i'm running my code in the release mode. 我正在发布模式下运行我的代码。 Good to go. 好去。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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