c++kinectkinect-sdk

error: '_Out_' has not been declared when including <Kinect.h>


I'm using CLion and I need to get some data from the Kinect, but when it comes to #include <Kinect.h> I get the following error:

    In file included from C:/PROGRA~1/MICROS~2/Kinect/V2D305~1.0_1/inc/Kinect.h:547,
             from C:\Users\fredd\CLionProjects\3D_avatar\main.cpp:19:
    C:/PROGRA~1/MICROS~2/Kinect/V2D305~1.0_1/inc/Kinect.INPC.h:109:13: error: '_Out_' has not been declared
         _Out_  WAITABLE_HANDLE *waitableHandle) = 0;
         ^~~~~

And an endless list of similar errors. I think I miss some kind of library that defines this data format, but I really don't know (if that's the problem) which one. I've searched all over the internet and googled for about 3 hours without any result. How can I solve the error? Also, is there a better way to make Kinect works with CLion?


Solution

  • I've managed to understand what was going on: MinGW couldn't compile SAL annotations, so I had to switch compiler to MSVC, bundled with Visual Studio. Also, I had to link MatLab with my project since there's no library (except for libfreenect2, which has driven me mad) that can handle a Kinect v2.