Multi-project of one solution for kinect application with windows sdk RRS feed

  • Question

  • Hi there, 

    I am now confronting a issue, as there are 3 major projects in my solution which are P1, P2 and P3 respectively. Basically, P1 is a MFC SDI, which is also the starting project for this solution. The other two, P2 and P3, are all CLR libraries with standard C++ format.

    There is a basically calling procedure, which is P1->P2->P3, which means in P1, I include P2, and in P2, I include P3. 

    Now I am regarding P3 as a driver class to drive the Kinect with MS. SDKS, and I have already set well for things such as additional include, additional libariy, or additional dependencies, etc. And also, in the cpp file of P2, I did the following:

    #include <Windows.h>
    #include <NuiApi.h>
    #include <Shlobj.h>

    Basically, the situation is that if I only rebuild P3, nothing wrong. But if I rebuild P2, which includes P3, there are full of wrongs, for example:

    error C2146: syntax error : missing ';' before identifier 'INuiAudioBeam'

    error C4430: missing type specifier - int assumed. Note: C++ does not support default-int

    error C2146: syntax error : missing ';' before identifier 'INuiFrameTexture'

    So I am wondering whether there is any suggestions from anyone of you with much more specific knowledge?

    If so, do pls tell me, as I am really anxious.

    Many thanks.

    Tuesday, February 25, 2014 10:41 AM

All replies

  • try reversing the order of the includes to match that of the samples.

    #include <windows.h>
    #include <objbase.h>
    #include <NuiApi.h>             // Include Dir: $(KINECTSDK10_DIR)inc;

    Carmine Sirignano - MSFT

    Tuesday, February 25, 2014 10:56 PM
  • thanks, basically, it really works for my situation. 

    But I cannot well understand the reason, as in my knowledge, objbase.h is something related with MFC. Here, as your notifying, I include this header in my P3, which is the kinect driver with standard C++ class and with nothing to do with MFC. So could you please further explain the reason for that?

    Many thanks.

    Wednesday, February 26, 2014 2:15 AM
  • objbase.h is for COM.

    The Kinect for Windows SDK header files defines interfaces that require the COM header files to resolve those types.

    Carmine Sirignano - MSFT

    Wednesday, February 26, 2014 10:03 PM