Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

Forcas

Problem with DirectInput8Create

This topic is 6386 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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."

Share this post


Link to post
Share on other sites
Advertisement
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."

Share this post


Link to post
Share on other sites
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."

Share this post


Link to post
Share on other sites
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."

Share this post


Link to post
Share on other sites
#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

Share this post


Link to post
Share on other sites
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

Share this post


Link to post
Share on other sites

  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!