When compiling this error appears

undefined reference to `WindProc(HWND__*, unsigned int, unsigned int, long)@16' LRESULT CALLBACK WindProc(HWND, UINT, WPARAM, LPARAM); (**) wndclassex.lpfnWndProc = WindProc; (*) 

The reason for the error in the string (*), as understood function (**) handles numerous messages. In my program, the task is one, create and run a window.

1 answer 1

LRESULT CALLBACK WindProc(HWND, UINT, WPARAM, LPARAM); only declares a function, but does not implement it. That's what the compiler curses. Write

 LRESULT CALLBACK WindProc(HWND hwnd, UINT uint, WPARAM wParam, LPARAM lParam){ return 0; } 

as a stub.

  • Thank you, I understand it should be declared before WinMain? - user206902
  • Not necessarily, but I think it will be easier. - Vladimir Martyanov