Well the first error is happening because you must define DIRECTINPUT_VERSION.
Code:
#ifndef CDINPUT
#define CDINPUT
//You MUST define this PRIOR to including dinput.h
#define DIRECTINPUT_VERSION 0x0800
#include <dinput.h>
class CDInput
{
protected:
IDirectInput8 *_pDI8;
public:
CDInput() { };
CDInput(HINSTANCE hinst) {Init(hinst);};
~CDInput() { };
HRESULT Init(HINSTANCE hinst);
void ShutDown(void) {if (_pDI8) _pDI8->Release();};
IDirectInput8 *GetInterface(void) {return _pDI8;};
};
#endif
The second error is happening because...I think....since you have not defined DIRECTINPUT_VERSION it is not sure which library to link with ---------- OR you are not correctly linking with dinput.lib or dinput8.lib. I had to link with both dinput8.lib and dinput.lib to get my code to work correctly.
Trust me I was so frustrated with DirectInput when I created my classes I wished I had never ever heard of the thing. I ran into the same errors you did on my first try.