Linker Errors
The first error appears (guessing) because you create** a window referencing MainWindowProc as the window procedure but that function doesn't appear (with that signature, anyway) in your code anywhere.
The second error appears to result from not linking in d3d11.lib, or your library path is incorrect***. Take a look at the docs for "D3D11CreateDeviceAndSwapChain." At the bottom of the page is listed "Requirements." Under that is a table listing the header you must "#include" and the library you must link.
**EDIT: actually, it's likely in the WNDCLASS(EX) struct in your RegisterClass(Ex) call.
If you have MainWindowProc in the WNDCLASS, somewhere you must have a function:
LRESULT CALLBACK MainWindowProc(HWND, UINT, WPARAM, LPARAM) { ... }
with those parameters.
***EDIT2: if your library path is incorrect and you have linked d3d11.lib, you'll get a "library not found" type error instead. Sorry about that.
Please don't PM me with questions. Post them in the forums for everyone's benefit, and I can embarrass myself publicly.
You don't forget how to play when you grow old; you grow old when you forget how to play.
The first error appears (guessing) because you create** a window referencing MainWindowProc as the window procedure but that function doesn't appear (with that signature, anyway) in your code anywhere.
The second error appears to result from not linking in d3d11.lib, or your library path is incorrect***. Take a look at the docs for "D3D11CreateDeviceAndSwapChain." At the bottom of the page is listed "Requirements." Under that is a table listing the header you must "#include" and the library you must link.
**EDIT: actually, it's likely in the WNDCLASS(EX) struct in your RegisterClass(Ex) call.
If you have MainWindowProc in the WNDCLASS, somewhere you must have a function:
LRESULT CALLBACK MainWindowProc(HWND, UINT, WPARAM, LPARAM) { ... }
with those parameters.
***EDIT2: if your library path is incorrect and you have linked d3d11.lib, you'll get a "library not found" type error instead. Sorry about that.
Thank you for the quick replay. The problem was coming from the fact that I haven't included the d3d11.lib in the Linker->Input->Additional Dependecies
One quick question: I've seen many people use the '#pragma comment(lib,"<name of library>")'. what is this and why is this needed?
#pragma comment(lib...
is an alternate way to specify linker options in MSVS. I use that, for instance, in my folder of "reusable" code snippets to remind me what library needs to be linked.
Discussed here.
EDIT: Thanks for posting the reason/solution for the problem.
Please don't PM me with questions. Post them in the forums for everyone's benefit, and I can embarrass myself publicly.
You don't forget how to play when you grow old; you grow old when you forget how to play.