Jump to content
  • Advertisement

Archived

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

DanTheRocker

Bit of a Problem

This topic is 6182 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''ve just started to reconstruct some code for a game of mine and I now get these two odd errors. c_dfDIKeyboard and the DirectInput8Create function are giving me trouble. I compiled some of Microsofts DirectInput Samples that use these and it Links fine. I copied the headers from that projectand put them in my project, but the error is still there. Am I missing and #defines or files? Im using VC++ 6.0. ANY help would be appreciated. --------------------------------------- The Error is as follows: Compiling... game.cpp Linking... game.obj : error LNK2001: unresolved external symbol _c_dfDIKeyboard game.obj : error LNK2001: unresolved external symbol _DirectInput8Create@20 Debug/Game.exe : fatal error LNK1120: 2 unresolved externals Error executing link.exe. --------------------------------------- Me headers areas follows: #define STRICT #define INITGUID #include #include #include #include Is something wrong here?

Share this post


Link to post
Share on other sites
Advertisement
Guest Anonymous Poster
you are forgetting to link with the DirectInput8 libraries.

#pragma comment(lib, "dinput8.lib")
#include <dinput.h>

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
This is how I link libraries.

#pragma comment(lib, "d3d8.lib");
#pragma comment(lib, "d3dx8.lib");
#pragma comment(lib, "dinput8.lib");

I''m unsure if this method works on all compilers.
I use Microsoft Visual C++ 6.0

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!