I'm doing a little test project. A simple interface for handling keyboard input in Windows, however I was getting a little problems for it to link. I made a simple program as follows:
vkeys is a static bool array inside class Input in Input.h.Code:#include <iostream> #include "Input.h" int main() { Input::vkeys[1] = true; if (Input::vkeys[1]) std::cout<<Input::vkeys[1]; }
However, no matter what type of project it is, it says
[Linker error] undefined reference to `Input::vkeys'
Don't you usually get the when linking to libraries. There are no libraries as this is a header defined by me. What do I do to get it to link?
If you need Input.h and .cpp(for function declarations), just say so.