问题描述
嗨King Nguyen,
Hi King Nguyen,
   我尝试构建您的代码以创建交互。但是当功能 NuiCreateInteractionStream()
被调用它给出了如下错误:
I tried to build your code to create interactions. But when the function NuiCreateInteractionStream() is called it gives me the error as following:
1> SkeletonBasics .obj:错误LNK2019:未解析的外部符号
_imp__NuiCreateInteractionStream @ 12在函数"private:long _thiscall CSkeletonBasics :: CreateFirstConnected(void)"中引用(?CreateFirstConnected @ CSkeletonBasics @@ QAEJXZ)
执行 NuiCreateInteractionStream()如下:
class interactionClient:public INuiInteractionClient
{
 公开:
      interactionClient()                                               {}
      ~interversClient()                                             {}
      STDMETHODIMP_(ULONG) AddRef()                                 {return S_OK;     }
      STDMETHODIMP_(ULONG) 发布()                                 {return S_OK;     }
      STDMETHODIMP         QueryInterface(REFIID riid,void ** ppv)   {return S_OK; }
      STDMETHODIMP GetInteractionInfoAtLocation(DWORD skeletonTrackingId,NUI_HAND_TYPE handType,FLOAT x,FLOAT y,NUI_INTERACTION_INFO * pInteractionInfo)
      {
          if(pInteractionInfo)
          {
              pInteractionInfo-> IsGripTarget       = true;
              pInteractionInfo-> PressTargetControlId = 0;
              pInteractionInfo-> PressAttractionPointX = 0.f;
              pInteractionInfo-> PressAttractionPointY = 0.f;
             返回S_OK;
          }
         返回E_POINTER;
      }
};
class interactionClient : public INuiInteractionClient
{
public:
interactionClient() {}
~interactionClient() {}
STDMETHODIMP_(ULONG) AddRef() { return S_OK; }
STDMETHODIMP_(ULONG) Release() { return S_OK; }
STDMETHODIMP QueryInterface(REFIID riid, void **ppv) { return S_OK; }
STDMETHODIMP GetInteractionInfoAtLocation(DWORD skeletonTrackingId, NUI_HAND_TYPE handType, FLOAT x, FLOAT y, NUI_INTERACTION_INFO *pInteractionInfo)
{
if(pInteractionInfo)
{
pInteractionInfo->IsGripTarget = true;
pInteractionInfo->PressTargetControlId = 0;
pInteractionInfo->PressAttractionPointX = 0.f;
pInteractionInfo->PressAttractionPointY = 0.f;
return S_OK;
}
return E_POINTER;
}
};
interactionClient m_nuiIClient;
.............................................. ...............
.............................................................
hr = m_pNuiSensor-> NuiInitialize(NUI_INITIALIZE_FLAG_USES_SKELETON | NUI_INITIALIZE_FLAG_USES_DEPTH_AND_PLAYER_INDEX | NUI_INITIALIZE_FLAG_USES_COLOR);
m_hNextInteractionEvent = CreateEvent(NULL,TRUE,FALSE,NULL);
hr = NuiCreateInteractionStream (m_pNuiSensor,(INuiInteractionClient *)& m_nuiIClient,& m_nuiIStream);
................... ..........................................
.............................................................
我收录了 输入中的strong> KinectInteraction170_64.lib 。但我不知道为什么
给出同样的错误?你能帮我吗???是否需要包含任何DLL?我该如何构建呢?
I included the KinectInteraction170_64.lib in the linker->input of the project. But I don't know why did it give the same error? Can u please help me??? Is there any dll need to be included?? How can I build it???
问候,
Vvk
推荐答案
也就是说,您从项目设置中收到链接器错误:
That said, you are getting a linker error from your project settings:
链接器工具错误LNK2019
http://msdn.microsoft.com/en-us/library/799kze2z.aspx
Linker Tools Error LNK2019
http://msdn.microsoft.com/en-us/library/799kze2z.aspx
你有链接吗?到适当的KinectInteraction170_(32/64).lib文件?您正在构建x64项目还是x86?
Did you link to the appropriate KinectInteraction170_(32/64).lib file? Are you building a x64 project or x86?
这篇关于编译InteractionStream代码时出现错误LNK2019的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!