none
Syntax Error Message from MSR_NUIAPI.h RRS feed

  • Question

  • Hello Everyone,

    My issue is this, every time that I compile my program which includes the MSR_NUIAPI.h, the compiler spits out a missing ';' before the INUIInstance interface declaration. I read this article(http://social.msdn.microsoft.com/Forums/en-ca/kinectsdknuiapi/thread/01b954d2-4095-4b2b-8713-7b47843d8752) which says that I have to include windows.h file before the MSR_NUIAPI.h, however I already have it included before, and I really doubt that this is an actual syntax mistake. Also, I have another project which does include both header files in the correct order and it compiles and runs. The only difference between both projects is that one runs on the Command Prompt and the other runs using the WINAPI method, but I really doubt it has anything to do with it. Please help, any little bit would help.

    Thank You

    Saturday, October 29, 2011 2:12 AM

All replies

  • Please copy-paste the top of your source file that gets this compilation issue. In particular, show all #include declarations and in particular the #include for MSR_NuiApi.h

    Also, which version of your program spits out the warning, the console (command prompt) version, or the WINAPI version (I'm guessing you mean Windows UI program, with WinMain function when you say WINAPI method).

    Eddy


    I'm here to help
    Tuesday, November 1, 2011 2:47 AM
  • This is the top of my source file:
    #include "stdafx.h"
    #include "windows.h"
    #include "Kinect.h"
    #include "MSR_NuiApi.h"
    Also, the version that spits out the error is the WINAPI version. The problem however isn't the source file, its the "MSR_NuiApi.h". Every time I compile, the error doesn't come out of the source file but MSR_NuiApi.h file. 
    Tuesday, November 1, 2011 2:05 PM
  • What definitions does your "stdafx.h" file have? Does it #include MSR_NuiApi.h also? Try #include "windows.h" as the first #include in stdafx.h file.

    Eddy


    I'm here to help
    Tuesday, November 1, 2011 10:16 PM
  • This is whats in my "stdafx.h".
     #include "targetver.h"
    #define WIN32_LEAN_AND_MEAN             // Exclude rarely-used stuff from Windows headers
    // Windows Header Files:
    #include <windows.h>
    // C RunTime Header Files
    #include <stdlib.h>
    #include <malloc.h>
    #include <memory.h>
    #include <tchar.h>
    Wednesday, November 2, 2011 2:06 PM
  • Hmm, I'm not sure. Are your compiler settings different between the application that works for you and the one that does not? Could you try declaring another interface in your code, e.g.:

    interface Foo
    {
        virtual void Bar() = 0;
    };

    and see if that doesn't work either.

    As I mentioned, some compiler flags such as "/Za" have an effect on extended C++ keywords such as "interface". See http://social.msdn.microsoft.com/Forums/en-US/vclanguage/thread/c8a50d60-c4e7-440b-8f27-0939da61d8a2 and http://stackoverflow.com/questions/299565/how-to-disable-interface-keyword-on-visual-c-express-2008

    Eddy


    I'm here to help
    Friday, November 4, 2011 6:29 PM
  • You mean declare that temp interface in the MSR_NuiApi.h file?
    Monday, November 7, 2011 2:41 PM
  • I mean just add that declaration temporarily anywhere in your code to see if your compiler complains about it too. If it complains, then you might have inadvertently changed your compiler settings in one project vs the other.

    Eddy


    I'm here to help
    Monday, November 7, 2011 7:41 PM
  •  But the thing is its that intellisense is telling me that the word 'interface' isn't defined, So I really think that that is the main problem. Plus, I'm worried that if changing a windows file is really a good idea, won't that affect any other programs that I build using the same header file? Also, I talked to a friend of mine and explained to him my problem, he told me that it could be that since the keyword interface may not be built into C++. 
    Monday, November 14, 2011 4:54 PM