I keep getting the following error when I try to compile my very simple program:
undefined reference to WindowProc(HWND__*, unsigned int, unsigned int, long)@16'
I don't see the problem and it's driving me crazy!
#include <iostream>
#include <windows.h>
using namespace std;
int sizeX = 500;
int sizeY = 500;
LRESULT CALLBACK WindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam);
char szClassName[ ] = "WindowsApp";
int WINAPI WinMain(
HINSTANCE hThisInstance,
HINSTANCE hPrevInstance,
LPSTR lpszArgument,
int nFunsterStil
)
{
HWND hwnd;
MSG messages;
WNDCLASSEX wincl;
wincl.hInstance = hThisInstance;
wincl.lpszClassName = szClassName;
wincl.lpfnWndProc = WindowProc;
wincl.style = CS_DBLCLKS;
wincl.cbSize = sizeof(WNDCLASSEX);`
wincl.hIcon = LoadIcon(NULL, IDI_APPLICATION);
wincl.hIconSm = LoadIcon(NULL, IDI_APPLICATION);
wincl.hCursor = LoadCursor(NULL, IDC_ARROW);
wincl.lpszMenuName = NULL;
wincl.cbClsExtra = 0;
wincl.cbWndExtra = 0;
wincl.hbrBackground = (HBRUSH) COLOR_BACKGROUND;
if(!RegisterClassEx(&wincl))
return 0;
hwnd = CreateWindowEx(
0,
szClassName,
"Windows App",
WS_SYSMENU,
CW_USEDEFAULT,
CW_USEDEFAULT,
sizeX,
sizeY,
HWND_DESKTOP,
NULL,
hThisInstance,
NULL
);
}
What is wrong with the code?