🔒 Locked
DXSDK samples
Advertisement
Original Post
Hi,
I'm very new to DirectX and I'm trying use DirectInput..so when I try to run the sample code (joystick.cpp) I get:
C:\DXSDK\samples\Multimedia\DirectInput\JoyStick\joystick.cpp(44) : error C2146: syntax error : missing ';' before identifier 'g_pDI'
C:\DXSDK\samples\Multimedia\DirectInput\JoyStick\joystick.cpp(44) : error C2501: 'LPDIRECTINPUT8' : missing storage-class or type specifiers
C:\DXSDK\samples\Multimedia\DirectInput\JoyStick\joystick.cpp(44) : fatal error C1004: unexpected end of file found
Error executing cl.exe.
can anybody tell me what I'm doing wrong??
Thanx,
Sher
[edited by - sherbear04 on May 3, 2004 1:56:29 PM]
I did not have d3d8.lib linked, but I just tried it and there was no change =(
Thank you very much for the suggestion!!
Thank you very much for the suggestion!!
including dinput.h didn''t work =(
how do I check the order of include directories??? (insert embarrassed smiley...)
thanx for helping!!
how do I check the order of include directories??? (insert embarrassed smiley...)
thanx for helping!!
ok, so I took care of the include and lib directories...but now I have:
Linking...
joystick.obj : error LNK2001: unresolved external symbol _c_dfDIJoystick2
joystick.obj : error LNK2001: unresolved external symbol _DirectInput8Create@20
joystick.obj : error LNK2001: unresolved external symbol _IID_IDirectInput8A
joystick.obj : error LNK2001: unresolved external symbol _GUID_POV
joystick.obj : error LNK2001: unresolved external symbol _GUID_Slider
joystick.obj : error LNK2001: unresolved external symbol _GUID_RzAxis
joystick.obj : error LNK2001: unresolved external symbol _GUID_RyAxis
joystick.obj : error LNK2001: unresolved external symbol _GUID_RxAxis
joystick.obj : error LNK2001: unresolved external symbol _GUID_ZAxis
joystick.obj : error LNK2001: unresolved external symbol _GUID_YAxis
joystick.obj : error LNK2001: unresolved external symbol _GUID_XAxis
LIBCD.lib(crt0.obj) : error LNK2001: unresolved external symbol _main
Debug/joystick.exe : fatal error LNK1120: 12 unresolved externals
Error executing link.exe.
Any thoughts?
Linking...
joystick.obj : error LNK2001: unresolved external symbol _c_dfDIJoystick2
joystick.obj : error LNK2001: unresolved external symbol _DirectInput8Create@20
joystick.obj : error LNK2001: unresolved external symbol _IID_IDirectInput8A
joystick.obj : error LNK2001: unresolved external symbol _GUID_POV
joystick.obj : error LNK2001: unresolved external symbol _GUID_Slider
joystick.obj : error LNK2001: unresolved external symbol _GUID_RzAxis
joystick.obj : error LNK2001: unresolved external symbol _GUID_RyAxis
joystick.obj : error LNK2001: unresolved external symbol _GUID_RxAxis
joystick.obj : error LNK2001: unresolved external symbol _GUID_ZAxis
joystick.obj : error LNK2001: unresolved external symbol _GUID_YAxis
joystick.obj : error LNK2001: unresolved external symbol _GUID_XAxis
LIBCD.lib(crt0.obj) : error LNK2001: unresolved external symbol _main
Debug/joystick.exe : fatal error LNK1120: 12 unresolved externals
Error executing link.exe.
Any thoughts?
Linking...
joystick.obj : error LNK2001: unresolved external symbol _DirectInput8Create@20
LIBCD.lib(crt0.obj) : error LNK2001: unresolved external symbol _main
Debug/joystick.exe : fatal error LNK1120: 2 unresolved externals
Error executing link.exe.
YAY! that got it down to only 3 errors =) is there something else that I also need to link???
joystick.obj : error LNK2001: unresolved external symbol _DirectInput8Create@20
LIBCD.lib(crt0.obj) : error LNK2001: unresolved external symbol _main
Debug/joystick.exe : fatal error LNK1120: 2 unresolved externals
Error executing link.exe.
YAY! that got it down to only 3 errors =) is there something else that I also need to link???
DirectInput8Create is in dinput8.lib, so you need to link to that as well. The unresolved main is most likely because you created a Win32 Console Application which looks for main as the program entry point, but you likely used WinMain instead of main. You probably want to use WinMain, but you need to create a Win32 Application, not a Win32 Console Application.
[edited by - CodeMunkie on May 3, 2004 4:02:58 PM]
[edited by - CodeMunkie on May 3, 2004 4:02:58 PM]
hehe um, how do I do that? =)
ok, so combining all your great advice I got the code to compile...but for some reason when I try to execute no window pops up =( why?!?!?!?!?!
Topic Locked
This topic has been locked by a moderator. New replies are not allowed.
Sign in to reply to this topic.
Advertisement