Skip to main content
gamedev.net
🔒 Locked

Direct input problem !!!!!!!!!

Started by GodsEvening 6 replies 300+ views
Original Post
GodsEvening
GodsEvening
When i compile my program some error message appeared --------------------Configuration: CreateDevice - Win32 Debug-------------------- Compiling... CreateDevice.cpp D:\C++\D3D_2D\CreateDevice.cpp(22) : error C2146: syntax error : missing '';'' before identifier ''g_pDI'' D:\C++\D3D_2D\CreateDevice.cpp(22) : error C2501: ''LPDIRECTINPUT8'' : missing storage-class or type specifiers D:\C++\D3D_2D\CreateDevice.cpp(22) : fatal error C1004: unexpected end of file found Error executing cl.exe. CreateDevice.obj - 3 error(s), 0 warning(s) My Code
  
#include <d3d8.h>
#include <D3dx8core.h>
#include <dinput.h>

//-----------------------------------------------------------------------------

// Global variables

//-----------------------------------------------------------------------------

LPDIRECT3D8             g_pD3D       = NULL; // Used to create the D3DDevice

LPDIRECT3DDEVICE8       g_pd3dDevice = NULL; // Our rendering device

LPDIRECT3DTEXTURE8      g_pTexture	 = NULL; // Used to hold the texture

LPD3DXSPRITE			g_pSprite	 = NULL; // Uesd to draw 2D


LPDIRECTINPUT8          g_pDI        = NULL; // Used to create the DIDevice

LPDIRECTINPUTDEVICE8    g_pKeyboard  = NULL; // Used to get input

  
I also linked to dxguid.lib & dinput8.lib in my project, I don''t know why, please help me thanks
Shabadoo
Shabadoo
Have you included dinput.h?

Shabadoo
GodsEvening
GodsEvening
yes ~~~

but still have problem ~~~~
kmsixpence
kmsixpence
I have two ideas. The first is that in my input class, I use LDIRECTINPUT instead of LPDIRECTINPUT8. There may not even be a directinput8 object. I use dx8 too.

Do you have the dinput8.lib library linked? whats happening is that it doesn''t recognise the LPDIRECTINPUT object which is in the dinput header and library.
GodsEvening
GodsEvening
I had tried to use LDIRECTINPUT instead of LPDIRECTINPUT8,
but same error message appeared ~~~~

pS I LINKED TO BOTH dxguid.lib & dinput8.lib IN MY PROJECT ~~
kmsixpence
kmsixpence
There''s an article a few days ago in sweet something about the dierct input getting running. Use the code from there, and check if its the same. If it isn''t, fix it. If it still doesn''t work, restart your computer. A few days ago I couldn''t get direct input up and running because it wouldn''t let me link for some reason. After restarting, it worked fine. If the problem still continues, maybe try installing the 8.1, not 8 version of the dxsdk. Otherwise, your computer must be screwed up.
sdoherty55
sdoherty55
I noticed that you are using drive D:. Where is your SDK installed, I believe prior to 8.1 it was installed under MSSDK and it is know under DXSDK. Are you compilier options for header files, and DLL pointing to the correct place. Do you have multiple installs of the SDK?
GodsEvening
GodsEvening
To kmsixpence:
I restart my computer, but the error didn''t solved ~~~ and i tried to compile the simple given by DX8SDK (about direct input) same error here ~~ so, maybe i need to install DX8.1 SDK. THX

To sdoherty55:
Yes i installed the DX8 sdk in c:, but i had added the path of include and lib of the DX8 SDK to VC++. But i installed DX8 and DX7 SDK in same driver (C. THX

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.