kinect环境配置

原文地址:http://blog.csdn.net/renyhui/article/details/52150984

第一步:环境的搭建,比较简单,不做介绍(win8及以上、VS2013、Kinect V2)

第二步:新建空项目,然后我们将一个Demo中的stdafx.h中的内容拷贝过来

[cpp]  view plain  copy
  在CODE上查看代码片 派生到我的代码片
  1. //------------------------------------------------------------------------------  
  2. // <copyright file="stdafx.h" company="Microsoft">  
  3. //     Copyright (c) Microsoft Corporation.  All rights reserved.  
  4. // </copyright>  
  5. //------------------------------------------------------------------------------  
  6.   
  7. // include file for standard system and project includes  
  8.   
  9. #pragma once  
  10.   
  11. #ifndef WIN32_LEAN_AND_MEAN  
  12. #define WIN32_LEAN_AND_MEAN             // Exclude rarely-used stuff from Windows headers   //不包含Windows中很少使用的头文件  
  13. #endif  
  14.   
  15. // Windows Header Files  
  16. #include <windows.h>  
  17.   
  18. #include <Shlobj.h>  
  19.   
  20. // Direct2D Header Files  
  21. #include <d2d1.h>  
  22.   
  23. // Kinect Header files  
  24. #include <Kinect.h>  
  25.   
  26. #pragma comment (lib, "d2d1.lib")  
  27.   
  28. #ifdef _UNICODE  
  29. #if defined _M_IX86  
  30. //manifest dependency清单依赖  
  31. //processor Architecture处理器架构  
  32. #pragma comment(linker,"/manifestdependency:\"type='win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' processorArchitecture='x86' publicKeyToken='6595b64144ccf1df' language='*'\"")  
  33. #elif defined _M_X64  
  34. #pragma comment(linker,"/manifestdependency:\"type='win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' processorArchitecture='amd64' publicKeyToken='6595b64144ccf1df' language='*'\"")  
  35. #else  
  36. #pragma comment(linker,"/manifestdependency:\"type='win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' processorArchitecture='*' publicKeyToken='6595b64144ccf1df' language='*'\"")  
  37. #endif  
  38. #endif  
  39.   
  40. // Safe release for interfaces  // 安全释放接口  
  41. template<class Interface>  
  42. inline void SafeRelease(Interface *& pInterfaceToRelease)  
  43. {  
  44.     if (pInterfaceToRelease != NULL)  
  45.     {  
  46.         pInterfaceToRelease->Release();  
  47.         pInterfaceToRelease = NULL;  
  48.     }  
  49. }  

如果此时不做任何操作,仅仅写一个主函数,会发现有错误无法打开包括文件“Kinect.h”

因为系统无法找到Kinect.h,所以此时需要对项目进行配置。

  • 项目->属性->C/C++->常规->附加包含目录中添加$(KINECTSDK20_DIR)\inc;
  • 链接器->常规->附加库目录中添加$(KINECTSDK20_DIR)\Lib\x86
  • 链接器->输入->附加依赖项中添加kinect20.lib
此时编译运行,程序应该通得过!
  • 0
    点赞
  • 16
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值