Kinect 开发新手。我想使用 MinGW 作为我的 Kinect for windows 的开发环境。
我已经在 c:\program files\Microsoft SDKS\kinect\v1.8 下安装了 Kinect for windows SDK。然后按照MSDN 中的这个示例,我编写了一个代码来初始化我的 Kinect 传感器。
当我编译使用:
g++ -c color.c -I "c:\Program Files\Microsoft SDKs\Kinect\v1.8\inc"
我收到一大堆警告和错误
警告
In file included from NuiApi.h:109:0, from color.c:2: c:\Program Files\Microsoft SDKs\Kinect\v1.8\inc/NuiSensor.h:137:8: warning: extra tokens at end of # endif directive [enabled by default] #endif _Vector4_ ^ c:\Program Files\Microsoft SDKs\Kinect\v1.8\inc/NuiSensor.h:160:8: warning: extra tokens at end of # endif directive [enabled by default] #endif _Matrix4_ ^ c:\Program Files\Microsoft SDKs\Kinect\v1.8\inc/NuiSensor.h:209:8: warning: extra tokens at end of # endif directive [enabled by default] #endif _NUI_SKELETON_POSITION_INDEX_ ... ...
从我搜索的内容来看,这些警告是由编译器差异引起的,因为 Kinect SDK 是为 Visual Studio 设计的,它们是可忽略的。
错误
NuiApi.h:47:5: error: definition of 'HRESULT NuiInitialize' is marked 'dllimport' NuiApi.h:47:5: error: '_In_' was not declared in this scope NuiApi.h:77:14: error: expected constructor, destructor, or type conversion before '(' token static_assert(E_NUI_FRAME_NO_DATA == 0x83010001, "Error code has changed."); ^ In file included from NuiApi.h:109:0, from color.c:2: c:\Program Files\Microsoft SDKs\Kinect\v1.8\inc/NuiSensor.h:2105:1: error: '_Check_return_' does not name a type _Check_return_ HRESULT NUIAPI NuiGetSensorCount( _In_ int * pCount ); ^ ...(tons of _Check_return does not name a type) c:\Program Files\Microsoft SDKs\Kinect\v1.8\inc/NuiImageCamera.h:78:39: error: '_In_' was not declared in this scope c:\Program Files\Microsoft SDKs\Kinect\v1.8\inc/NuiImageCamera.h:78:70: error: '_Out_' was not declared in this scope
问题
我了解这些错误中的大部分(如果不是全部)是因为 Kinect SDK 是为 VS 设计的。但我是一个新手,想了解更多关于下面发生的事情。那么我可以让我的 g++ 与 Kinect SDK 一起使用吗?任何帮助将不胜感激!!
顺便说一下,这是一个相关的页面: