none
Compilation error (C++) C2146 msr_nuiimagecamera.h AND not solved by windows.h included first RRS feed

  • General discussion

  • Hi,

    I am trying to compile the sdk in C++ (I have VS2010) and get several errors.

    The configuration is identical to the KinectSDKSample SkeletalViewer.

    Including windows.h before MSR_NuiApi.h doesn't solve the problem.

    Here is the output of the build:

    1>------ Build started: Project: Test, Configuration: Debug Win32 ------
    1>  stdafx.cpp
    1>c:\program files\microsoft sdks\kinect\v1.0 beta2\inc\msr_nuiimagecamera.h(102): error C2146: syntax error : missing ';' before identifier 'INuiFrameTexture'
    1>c:\program files\microsoft sdks\kinect\v1.0 beta2\inc\msr_nuiimagecamera.h(102): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
    1>c:\program files\microsoft sdks\kinect\v1.0 beta2\inc\msr_nuiimagecamera.h(102): error C2470: 'INuiFrameTexture' : looks like a function definition, but there is no parameter list; skipping apparent body
    1>c:\program files\microsoft sdks\kinect\v1.0 beta2\inc\msr_nuiimagecamera.h(116): error C2144: syntax error : 'int' should be preceded by ';'
    1>c:\program files\microsoft sdks\kinect\v1.0 beta2\inc\msr_nuiimagecamera.h(116): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
    1>c:\program files\microsoft sdks\kinect\v1.0 beta2\inc\msr_nuiimagecamera.h(116): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
    1>c:\program files\microsoft sdks\kinect\v1.0 beta2\inc\msr_nuiapi.h(132): error C2146: syntax error : missing ';' before identifier 'INuiInstance'
    1>c:\program files\microsoft sdks\kinect\v1.0 beta2\inc\msr_nuiapi.h(132): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
    1>c:\program files\microsoft sdks\kinect\v1.0 beta2\inc\msr_nuiapi.h(132): error C2086: 'int interface' : redefinition
    1>          c:\program files\microsoft sdks\kinect\v1.0 beta2\inc\msr_nuiimagecamera.h(101) : see declaration of 'interface'
    1>c:\program files\microsoft sdks\kinect\v1.0 beta2\inc\msr_nuiapi.h(132): error C2470: 'INuiInstance' : looks like a function definition, but there is no parameter list; skipping apparent body
    1>c:\program files\microsoft sdks\kinect\v1.0 beta2\inc\msr_nuiapi.h(204): error C2061: syntax error : identifier 'INuiInstance'
    1>c:\program files\microsoft sdks\kinect\v1.0 beta2\inc\msr_nuiapi.h(205): error C2065: 'INuiInstance' : undeclared identifier
    1>c:\program files\microsoft sdks\kinect\v1.0 beta2\inc\msr_nuiapi.h(205): error C2065: 'pInstance' : undeclared identifier
    1>c:\program files\microsoft sdks\kinect\v1.0 beta2\inc\msr_nuiapi.h(205): error C2182: 'MSR_NuiDestroyInstance' : illegal use of type 'void'
    1>c:\program files\microsoft sdks\kinect\v1.0 beta2\inc\msr_nuiapi.h(205): error C2491: 'MSR_NuiDestroyInstance' : definition of dllimport data not allowed
    1>c:\program files\microsoft sdks\kinect\v1.0 beta2\inc\msr_nuiapi.h(205): fatal error C1903: unable to recover from previous error(s); stopping compilation
    ========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========

    Hope you can help :)

    Thanks!

    Wednesday, December 21, 2011 11:54 AM

All replies

  • Ok, if you have the same problem, I found that including

    #include <basetyps.h>
    #include <WTypes.h>
    before MSR_NuiApi.h solve the problem :)

    • Edited by TangoCharli3 Wednesday, December 21, 2011 12:09 PM
    Wednesday, December 21, 2011 12:07 PM