Note that there are some explanatory texts on larger screens.

plurals
  1. POWin32 Static Variable link error
    primarykey
    data
    text
    <p>Why does this happen?</p> <blockquote> <p>1>------ Build started: Project: Client, Configuration: Debug Win32 ------<br> 1> WindowManager.cpp<br> 1> Generating Code...<br> 1> Compiling...<br> 1> Main.cpp<br> 1> Generating Code...<br> 1>WindowManager.obj : error LNK2001: unresolved external symbol<br> "private: static int WindowManager::win_stat" (?win_stat@WindowManager@@0HA) 1>C:\Users\user\documents\visual studio 2012\Projects\TalkToMe\Debug\Client.exe : fatal error LNK1120: 1 unresolved externals<br> ========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========</p> </blockquote> <p>WindowManager.cpp</p> <pre><code>#include "WindowManager.h" void WindowManager::PekMessage() { if(PeekMessage(&amp;msg, window, 0, 0, PM_REMOVE)) { TranslateMessage(&amp;msg); DispatchMessage(&amp;msg); } } bool WindowManager::isWindowOpen() { return win_stat != -1; } HWND WindowManager::textbox(int width, int height, int xPos, int yPos, LPCSTR content, bool edit_able) { int type = (edit_able) ? (WS_CHILD|WS_VISIBLE|ES_AUTOHSCROLL) : (WS_CHILD|WS_VISIBLE|WS_HSCROLL|ES_AUTOHSCROLL); return CreateWindowEx( WS_EX_CLIENTEDGE, "EDIT", content, type, xPos, yPos, width, height, window, (HMENU)50, GetModuleHandle(NULL), NULL ); } HWND WindowManager::textbox(Vector size, Vector position, LPCSTR content, bool edit_able) { return textbox(size.getX(), size.getY(), position.getX(), position.getY(), content, edit_able); } LRESULT CALLBACK WindowManager::WindowProcedure(HWND winhan,UINT uint_Message,WPARAM parameter1,LPARAM parameter2) { switch(uint_Message) { case 16: // exit button win_stat = -1; break; } return DefWindowProc(winhan,uint_Message,parameter1,parameter2); } WindowManager::WindowManager(LPCTSTR title,int x, int y, int width, int height) { WNDCLASSEX wnd; wnd.cbSize = sizeof(wnd); wnd.style = CS_HREDRAW | CS_VREDRAW; wnd.lpfnWndProc = WindowProcedure; wnd.cbClsExtra = 0; wnd.cbWndExtra = 0; wnd.hInstance = GetModuleHandle(NULL); wnd.hIcon = NULL; wnd.hCursor = LoadCursor(NULL,IDC_ARROW); wnd.hbrBackground = GetSysColorBrush(NULL); wnd.lpszClassName = "TalkToMe"; wnd.lpszMenuName = NULL; wnd.hIconSm = LoadIcon(NULL, IDI_APPLICATION); RegisterClassEx(&amp;wnd); window = CreateWindowEx(WS_EX_CONTROLPARENT, wnd.lpszClassName, title, WS_OVERLAPPED | WS_CAPTION | WS_SYSMENU | WS_MINIMIZEBOX | WS_VISIBLE, x, y, width, height,NULL, NULL, GetModuleHandle(NULL), NULL); } WindowManager::~WindowManager() { DestroyWindow(window); } </code></pre> <p>WindowManager.h</p> <pre><code>#pragma once #pragma comment(linker,"\"/manifestdependency:type='win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' processorArchitecture='*' publicKeyToken='6595b64144ccf1df' language='*'\"") #include &lt;Windows.h&gt; #include "Vector.h" class WindowManager { private: MSG msg; HWND window; static int win_stat; public: WindowManager(LPCTSTR title,int x, int y, int width, int height); ~WindowManager(); static LRESULT CALLBACK WindowProcedure(HWND winhan,UINT uint_Message,WPARAM parameter1,LPARAM parameter2); HWND textbox(int width, int height, int xPos, int yPos, LPCSTR content, bool edit_able=true); HWND textbox(Vector size, Vector position, LPCSTR content, bool edit_able=true); bool isWindowOpen(); void PekMessage(); }; </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload