I am trying to make a simple engine with WinAPI and I encounter this problem:
class Window {
....
public:
static HINSTANCE hInst;
....
};
....
....
....
int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance,
LPSTR lpCmdLine, int nCmdShow)
{
MSG msg;
Window::hInst = hInstance;
....
....
}
The errors:
main.obj : error LNK2001: unresolved external symbol "public: static struct HINSTANCE__ * Window::hInst" (?hInst@Window@@2PAUHINSTANCE__@@A)
C:\Users\invisal\Documents\Visual Studio 2008\Projects\Project1\StuMg\Debug\StuMg.exe : fatal error LNK1120: 1 unresolved externals
Build log was saved at "file://c:\Users\invisal\Documents\Visual Studio 2008\Projects\Project1\StuMg\StuMg\Debug\BuildLog.htm"
StuMg - 2 error(s), 0 warning(s)