I am trying to make a simple engine with WinAPI and I encounter this problem:

class Window {
	        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)

Try placing a line like:

HINSTANCE Window::hInst;

and initialize it with a default value if possible like a good little variable outside the class; after the closing semicolon of the class declaration and before declaring main().

thank man :D
This question has already been answered. Start a new discussion instead.