Skip to main content
gamedev.net
🔒 Locked

Problem with DirectInput8Create

Started by Forcas Jan 25, 2001 at 8:54 PM 6 replies 1.1k views
Original Post
Forcas
Forcas
I call the function like this:
  if(FAILED(DirectInput8Create(hMainInstance, DIRECTINPUT_VERSION, IID_IDirectInput8, &lpdi, NULL));  
this is the error I get. C:\mssdk\samples\Multimedia\DDraw\src\dd7kikarse\main.cpp(137) : error C2664: ''DirectInput8Create'' : cannot convert parameter 4 from ''struct IDirectInput8A ** '' to ''void ** '' I copied that code right out of the SDK help file. WHat could be the problem? -Forcas
"Elvis is alive. He is Barney the purple dinosaur. He is the pied piper that leads our children into the wages of sin and eternal damnation."
-Forcas writeln("Does this actually work?");
Forcas
Forcas
oh yeah.... I''ve got 3 closing parenthesis before the ;


-Forcas


"Elvis is alive. He is Barney the purple dinosaur. He is the pied piper that leads our children into the wages of sin and eternal damnation."
-Forcas writeln("Does this actually work?");
Forcas
Forcas
Well now that I have that outta the way, I''ve got a new problem:
main.obj : error LNK2001: unresolved external symbol _DirectInput8Create@20
main.obj : error LNK2001: unresolved external symbol _IID_IDirectInput8A
Debug/dd7kikarse.exe : fatal error LNK1120: 2 unresolved externals

I copied the dinput.h file from my dx8/include directory to the vc/include directory. Same with Dinput.lib. ARghh... probably some .lib file that I don''t need to include?


-Forcas


"Elvis is alive. He is Barney the purple dinosaur. He is the pied piper that leads our children into the wages of sin and eternal damnation."
-Forcas writeln("Does this actually work?");
Quantum
Quantum
dxguid.lib
ITH3
ITH3
Include dinput8.lib instead of dinput.lib
Forcas
Forcas
Okay.... I added dinput8.lib to my project and got rid of the first error message, but now I still have this:

main.obj : error LNK2001: unresolved external symbol _IID_IDirectInput8A


-Forcas


"Elvis is alive. He is Barney the purple dinosaur. He is the pied piper that leads our children into the wages of sin and eternal damnation."
-Forcas writeln("Does this actually work?");
Liquid
Liquid
#define INITGUID
once, and only once, before including any DirectX files. That should fix your problem.

Also, you should never copy files over the ones that came with your compiler. Instead, place all of the updated files in another directory
(like c:\Program Files\Microsoft Visual Studio\vc98\include\DX8) and go Tools->Options->Directories->Add and add the directory you put all the new stuff in to the list. You can then use the up and down arrow buttons to move the directory you just added up above the default MSVC include paths.

Liquid
Liquid
Liquid
Or, instead of #define INITGUID, you could just link with dxguid like Quantum suggested above. Make sure that the compiler is linking with the DX8 version though, and not the version that shipped with the compiler.

Liquid

Topic Locked

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

Sign in to reply to this topic.