Archived

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

Bit of a Problem

This topic is 6001 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
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
is that how you link libs if there is no option under the project setting in the compiler?! Pragma? Please respond!

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