#error : Xiron Platform Abstraction Layer

OpenNI1.5 VS2013配置环境后,编译会出现这个错误:

错误    4    error C1189: #error :  Xiron Platform Abstraction Layer - Win32 - Microsoft Visual Studio versions above 2010 (10.0) are not supported!    c:program filesopenniincludeXnPlatform.h    57    1    test

原因是OpenNI的 XnPlatform.h里边有一段版本检查代码:

#ifndef RC_INVOKED
        #if _MSC_VER < 1300 // Before MSVC7 (2003)
            #error Xiron Platform Abstraction Layer - Win32 - Microsoft Visual Studio versions below 2003 (7.0) are not supported!
        #endif

        #if _MSC_VER > 1600 // After MSVC8 (2010)
            #error Xiron Platform Abstraction Layer - Win32 - Microsoft Visual Studio versions above 2010 (10.0) are not supported!
        #endif
    #endif

解决方案:

用管理员身份运行VS,打开项目,找到报错位置(会定向到XnPlatform.h),把1600改为1900, 保存即可

原文地址:https://www.cnblogs.com/asmer-stone/p/5537111.html