Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Direct Input compilation

Status
Not open for further replies.

Drone38

Programmer
Apr 12, 2000
29
0
0
BE
Can anybody explain me why the compiler can't make my programm.<br>Error :[Lieur Erreur] Unresolved external '_c_dfDIMouse' referenced from D:\PROGRAMMATION\C++\POKEMON\UNIT1.OBJ.<br>I have include dinput.h.<br><br>Look at this code :<br><br>&nbsp;&nbsp;&nbsp;&nbsp;HRESULT hr;<br>&nbsp;&nbsp;&nbsp;&nbsp;hr = DirectInputCreate( HInstance , DIRECTINPUT_VERSION, &g_pDI, NULL );<br>&nbsp;&nbsp;&nbsp;&nbsp;if ( FAILED(hr) )<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;return hr;<br>&nbsp;&nbsp;&nbsp;&nbsp;hr = g_pDI-&gt;CreateDevice( GUID_SysMouse, &g_pMouse, NULL );<br>&nbsp;&nbsp;&nbsp;&nbsp;if ( FAILED(hr) )<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;return hr;<br>&nbsp;&nbsp;&nbsp;&nbsp;hr = g_pMouse-&gt;SetDataFormat( &c_dfDIMouse ); // The error come from here...<br>&nbsp;&nbsp;&nbsp;&nbsp;if ( FAILED(hr) )<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;return hr;<br>&nbsp;&nbsp;&nbsp;&nbsp;hr = g_pMouse-&gt;SetCooperativeLevel( hDlg,DISCL_EXCLUSIVE ¦ DISCL_FOREGROUND);<br>&nbsp;&nbsp;&nbsp;&nbsp;if ( FAILED(hr) )<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;return hr;<br><br>Remark than I can't use all predifinded parameter :<br><br> c_dfDIKeyboard <br> c_dfDIMouse <br> c_dfDIMouse2 <br> c_dfDIJoystick <br> c_dfDIJoystick2<br>&nbsp;&nbsp;<br>I absolute need an anwer because in my game, I need to retrive the position of the mouse and the classical API don't work when you're under DirectX.<br>
 
&nbsp;&nbsp;&nbsp;&nbsp;An <i>unresolved external</i> error usually means that you have not included the proper header file. The compiler/linker is looking for <i>_c_dfDIMouse</i> but can't find it in the included files. Where is <i>_c_dfDIMouse</i> defined? Have you put that header in your program (e.g. <i>#include &lt;mouse.h&gt;</i>)?<br> <p>James P. Cottingham<br><a href=mailto: > </a><br><a href= Veneer Co., Inc.</a><br>All opinions are mine alone and do not necessarily reflect those of my employer.
 
Yes I have include this file, but it doesn't work anyway
 
if header file is included then try to give the path of obj file. I think it could be a path problem.<br><br>Siddhartha Singh <p>Siddhartha Singh<br><a href=mailto:siddhu_singh@hotmail.com>siddhu_singh@hotmail.com</a><br><a href=siddhu.freehosting.net> </a><br>
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top