How do I run these c++ and c files for NiHandTracker?

  asus-xtion, c++

main.cpp

#include "NiHandViewer.h"


//---------------------------------------------------------------------------
// Defines
//---------------------------------------------------------------------------
#define SAMPLE_XML_PATH "../../../Data/SamplesConfig.xml"


//---------------------------------------------------------------------------
// Globals
//---------------------------------------------------------------------------
xn::Context     g_context;
xn::ScriptNode  g_scriptNode;


int main(int argc, char* argv[])
{
    XnStatus                rc;
    xn::EnumerationErrors   errors;

    // Create a context with default settings
    rc = g_context.InitFromXmlFile(SAMPLE_XML_PATH, g_scriptNode, &errors);
    if (rc == XN_STATUS_NO_NODE_PRESENT)
    {
        XnChar strError[1024];
        errors.ToString(strError, 1024);
        printf("%sn", strError);
        return (rc);
    }
    else if (rc != XN_STATUS_OK)
    {
        printf("Open failed: %sn", xnGetStatusString(rc));
        return (rc);
    }

    SimpleViewer& viewer = HandViewer::CreateInstance(g_context);

    rc = viewer.Init(argc, argv);
    if (rc != XN_STATUS_OK)
    {
        printf("Viewer init failed: %sn", xnGetStatusString(rc));
        return 1;
    }

    rc = viewer.Run();
    if (rc != XN_STATUS_OK)
    {
        printf("Viewer run failed: %sn", xnGetStatusString(rc));
        return 1;
    }

    return 0;
}

I tried compiling it. g++ main.cpp -o main and got:

NiSimpleViewer.h:25:10: fatal error: XnCppWrapper.h: No such file 
or directory                                                      cker$ APTOP-QIFEOL3I:/mnt/c/Program 
   25 | #include <XnCppWrapper.h>

Source: Windows Questions C++

LEAVE A COMMENT