-2

I follow the tutorial here: Mouse and keyboard input I don't get any error if i delete everything that has to do with DirectX. If i use pointer insted then i get a error that says my inputhandler constructor was deleted. Any ideas? Printscreen h

   #pragma once

#include <Windows.h>
#include "DirectXTK-master\Inc\Keyboard.h"
#include "DirectXTK-master\Inc\Mouse.h"

class InputHandler
{
public:
    InputHandler();

    InputHandler(HWND wndHandle);
    ~InputHandler();

    void updateInput();

private:
    std::unique_ptr<DirectX::Keyboard> keyboard;
    std::unique_ptr<DirectX::Mouse> mouse;

};

cpp

#include "InputHandler.h"



InputHandler::InputHandler()
{
}


InputHandler::InputHandler(HWND wndHandle)
{
    keyboard = std::make_unique<DirectX::Keyboard>();
    mouse = std::make_unique<DirectX::Mouse>();
    mouse->SetWindow(wndHandle);
}

InputHandler::~InputHandler()
{
}

void InputHandler::updateInput()
{
    auto kb = keyboard->GetState();
    if (kb.Escape)
        PostQuitMessage(0);

    auto mouseState = mouse->GetState();
}
Hamaro
  • 49
  • 9
  • please share your code directly – NIKHIL NEDIYODATH Mar 28 '18 at 19:16
  • Possible duplicate of [What is an undefined reference/unresolved external symbol error and how do I fix it?](https://stackoverflow.com/questions/12573816/what-is-an-undefined-reference-unresolved-external-symbol-error-and-how-do-i-fix) – Justin Mar 28 '18 at 19:16

1 Answers1

3

You still need to link to the DirectX Tool Kit static library. The tutorials assume you are making use of the NuGet package or have added a Reference to the DirectXTK project per the Adding the DirectX Tool Kit tutorial step which would add the static library to your project build.

Chuck Walbourn
  • 38,259
  • 2
  • 58
  • 81