Unusual compiler error in C++ program. Not syntax related. Windows programming
===

`enter code here`I'm trying to compile this program in C++ MSVS2010 and am getting odd compiler errors such as 

Error	12	error LNK1120: 1 unresolved externals	C:\Users\win7vm\Documents\Visual Studio 2010\Projects\WinDemo Summer2012 FINAL 120725a Move Scale and Rotate Triangle\Debug\WinDemo Summer2012.exe	1
.  
and I'm also getting 

Error	11	error LNK2019: unresolved external symbol "public: int __thiscall Dice::returnRoll(void)" (?returnRoll@Dice@@QAEHXZ) referenced in function "public: void __thiscall Dice::drawSpots(struct HDC__ *,int,int,int,int,int,int,int)" (?drawSpots@Dice@@QAEXPAUHDC__@@HHHHHHH@Z)	C:\Users\win7vm\Documents\Visual Studio 2010\Projects\WinDemo Summer2012 FINAL 120725a Move Scale and Rotate Triangle\WinDemo Summer2012\Dice.obj

Neither of which seem to be syntax related and I'm not fully understanding them.
Basically, the idea is to get the switch statement to display the value passed into that function from the other function.  I'm almost certain that it is a simple reference/pointer issue that I'm just completely missing.  Let me pre-answer 2 questions that will almost certainly come up: a) yes, it absolutely has to use the windows.h file in c++.  b) yes, I'm aware that there are a hundred better libraries and languages to use for this problem, I have no choice in the matter here.  Someone may also try to pull a captain obvious on the global variables declared.  Let me save you time -- if you have a solution that works then I'm all ears otherwise the globals were a temporary but necessary inconvenience in a relatively short block of code.  I realize that many of you are extremely skilled in C++ but I am asking for your patience to explain your answers with my lower-level of C++ programming in mind.  Thank you. :)

**
//header file

    #include <windows.h>
    #include <math.h>
    #include <vector>
    using namespace std;
    
    int count=0;
    int *result = &count;
    
    class Dice
    {
    public:
    	void drawSpots(HDC hdc, int x1,int y1, int x2,int y2, int r, int g,int b);
    	int roll();
    	wchar_t * drawString();
    	int returnRoll();
    private:
    	int x1,x2,y1,y2,sr,sg,sb;
    	//int &count;
    	//int *result;
    	int value;
    	int spotColor;
    };
    
    
    //definitions file
    
    
    void Dice::drawSpots(HDC hdc, int x1,int y1, int x2,int y2, int r, int g,int b)
    {
    	*result = roll();
    	//vectorOfDice.push_back(result);
    	//wchar_t * drawString();
    	returnRoll();
    	HBRUSH hBrush = CreateSolidBrush(RGB(r,g,b));
    	SelectObject(hdc,hBrush);
    	switch(*result)
    	{
    	case 1:
    		//draw something based on case
    		break;
    	case 2:
    		//draw something based on case
    		break;
    	case 3:
    		//draw something based on case
    		break;
    	case 4:
    		//draw something based on case
    		break;
    	case 5:
    		//draw something based on case		
                        break;
    	case 6:
    		//draw something based on case		
                        break;
    	}
    
    	DeleteObject(hBrush);
    }
    
    int Dice::roll()
    {
    	value=1+(rand()%6);
    	return value;
    }
    
    
    int returnRoll()
    {
    	count=0;
    	if((*result == 2)||(*result == 4)||(*result == 6))
    	{
    		count++;
    	}
    	return count;
    }
    
    wchar_t * Dice::drawString()
    {
    	//result = returnRoll(result);
    	//result = roll();
    	switch(*result)
    	{
    	case 0:
    		return L"no";
    		break;
    	case 1:
    		return L"1";
    		break;
    	case 2:
    		return L"2";
    		break;
    	case 3:
    		return L"3";
    		break;
    	case 4:
    		return L"4";
    		break;
    	case 5:
    		return L"5";
    		break;
    	case 6:
    		return L"6";
    		break;
    	}
    	return L"X";
    }
    
    
    //main file
    
    
    #include <windows.h>
    #include <math.h>
    #include "Dice.h"
    
    
    const wchar_t g_szClassName[] = L"myWindowClass";
    
    
    
    // Step 4: the Window Procedure
    LRESULT CALLBACK WndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
    {
    	Dice dice;
    	
    	//state variables
    	static int red = 0;
    	static int green = 0;
    	static int blue = 100;
    
    	static int tr = 0;
    	static int tg = 0;
    	static int tb = 0;
    
    	HDC hDC;
    	PAINTSTRUCT Ps;
    	HPEN hPen1;
    	HPEN hPen2;
    
    
    	HBRUSH hBrush1;
    	HFONT hFont1;
    	RECT rect;
    	int fontHeight = 100;
    
    
        switch(msg)
        {
    		case WM_PAINT:
    			hDC = BeginPaint(hwnd,&Ps);
    
    			hPen1=CreatePen(PS_SOLID,5,RGB(red,green,blue));
    			hPen2=CreatePen(PS_SOLID,5,RGB(0,0,0));
    
    			hBrush1= CreateSolidBrush(RGB(0,0,255));
    
    			SelectObject(hDC,hPen1);
    			SelectObject(hDC,hBrush1);
    
    			fontHeight=50;
    			hFont1=CreateFont(fontHeight,0,0,0,0,1,0,0,0,0,0,0,0,L"Times New Roman");
    			//hFont1=CreateFont(fontHeight,0,0,0,0,0,0,0,0,0,0,0,0,L"Arial");
    			SelectObject(hDC,hFont1);
    
    			rect.top=100;
    			rect.bottom=700;
    			rect.left = 550;
    			rect.right =950;
    
    			DrawText(hDC,L"There are ",-1,&rect,DT_CENTER | DT_WORDBREAK );
    			rect.top=200;
    			DrawText(hDC,dice.drawString(),-1,&rect,DT_CENTER | DT_WORDBREAK );
    			rect.top=300;
    			DrawText(hDC,L" even dice!",-1,&rect,DT_CENTER | DT_WORDBREAK );
    
    
    			DeleteObject(hBrush1);
    			DeleteObject(hPen2);
    			DeleteObject(hPen1);
    			EndPaint(hwnd,&Ps);
    		break;
    		case WM_KEYDOWN:
    			if(wParam==VK_SPACE)
    			{
    				dice.roll();
    				InvalidateRect(hwnd,NULL,true);
    			}
    			break;
    		case WM_CHAR:
    			if(wParam=='c')
    			{
    				tr=rand()%256;
    				tg=rand()%256;
    				tb=rand()%256;
    				dice.spotColors();
    			}
    			InvalidateRect(hwnd,NULL,true);
    			break;
            case WM_CLOSE:
                DestroyWindow(hwnd);
            break;
            case WM_DESTROY:
                PostQuitMessage(0);
            break;
            default:
                return DefWindowProc(hwnd, msg, wParam, lParam);
        }
        return 0;
    }
    
    int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance,
        LPSTR lpCmdLine, int nCmdShow)
    {
        WNDCLASSEX wc;
        HWND hwnd;
        MSG Msg;
    
        //Step 1: Registering the Window Class
        wc.cbSize        = sizeof(WNDCLASSEX);
        wc.style         = 0;
        wc.lpfnWndProc   = WndProc;
        wc.cbClsExtra    = 0;
        wc.cbWndExtra    = 0;
        wc.hInstance     = hInstance;
        wc.hIcon         = LoadIcon(NULL, IDI_APPLICATION);
        wc.hCursor       = LoadCursor(NULL, IDC_ARROW);
        wc.hbrBackground = (HBRUSH)(COLOR_WINDOW+1);
        wc.lpszMenuName  = NULL;
        wc.lpszClassName = g_szClassName;
        wc.hIconSm       = LoadIcon(NULL, IDI_APPLICATION);
    
        if(!RegisterClassEx(&wc))
        {
            MessageBox(NULL, L"Window Registration Failed!", L"Error!",
                MB_ICONEXCLAMATION | MB_OK);
            return 0;
        }
    
        // Step 2: Creating the Window
        hwnd = CreateWindowEx(
            WS_EX_CLIENTEDGE,
            g_szClassName,
            L"window",
            WS_OVERLAPPEDWINDOW,
            CW_USEDEFAULT, CW_USEDEFAULT, 1000, 800,
            NULL, NULL, hInstance, NULL);
    
        if(hwnd == NULL)
        {
            MessageBox(NULL, L"Window Creation Failed!", L"Error!",
                MB_ICONEXCLAMATION | MB_OK);
            return 0;
        }
    
        ShowWindow(hwnd, nCmdShow);
        UpdateWindow(hwnd);
    
        // Step 3: The Message Loop
        while(GetMessage(&Msg, NULL, 0, 0) > 0)
        {
            TranslateMessage(&Msg);
            DispatchMessage(&Msg);
        }
        return Msg.wParam;
    }

**
