这是什么原因?小弟编译不过啊

sgch1982 2005-05-26 02:53:06
Creating library Debug/v.lib and object Debug/v.exp
GameView.obj : error LNK2001: unresolved external symbol _GUID_SysKeyboard
GameView.obj : error LNK2001: unresolved external symbol _DirectInput8Create@20
GameView.obj : error LNK2001: unresolved external symbol _IID_IDirectInput8A
dinput.lib(dilib2.obj) : error LNK2001: unresolved external symbol _GUID_Key
//1.Creating the DirectInput Object
HRESULT hr=DirectInput8Create(AfxGetInstanceHandle(),DIRECTINPUT_VERSION,IID_IDirectInput8,(void**)&m_pDInput,NULL);
if(FAILED(hr))
{
Trace("Create DInput fail!");
ASSERT(false);
return false;
}
else
{
Trace("Create DInput succeed!");
}
//2.Creating the DirectInput Keyboard Device
hr=m_pDInput->CreateDevice(GUID_SysKeyboard,&m_pKeyboard,NULL);
if(FAILED(hr))
{
Trace("Create keyboard device fail!");
ReleaseDInput();
ASSERT(false);
return false;
}
else
{
Trace("Create keyboard device succeed!");
}
//3.Setting the Keyboard Data Format
m_pKeyboard->SetDataFormat(&c_dfDIKeyboard);
//4.get the top hwnd
HWND hParent = ::GetParent(m_hWnd);
HWND hWndTop = hParent;
while(IsWindow(hParent))
{
hWndTop = hParent;
hParent = ::GetParent(hParent);
}
//5.Setting the Keyboard Behavior
hr = m_pKeyboard->SetCooperativeLevel(hWndTop,DISCL_FOREGROUND | DISCL_NONEXCLUSIVE );
if(FAILED(hr))
{
Trace("Setting the Keyboard Behavior fail!");
ReleaseDInput();
ASSERT(false);
return false;
}
//6.Gaining Access to the Keyboard
m_pKeyboard->Acquire();
...全文
81 2 打赏 收藏 转发到动态 举报
写回复
用AI写文章
2 条回复
切换为时间正序
请发表友善的回复…
发表回复
zdingyi 2005-06-28
  • 打赏
  • 举报
回复
在.h文件中加入
#progma comment (lib,"dinput8.lib")
summer54 2005-05-26
  • 打赏
  • 举报
回复
可能是缺少 *.lib

8,305

社区成员

发帖
与我相关
我的任务
社区描述
游戏开发相关内容讨论专区
社区管理员
  • 游戏开发
  • 呆呆敲代码的小Y
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧