Including windows.h is only for compiler. When compiler compiles code that calls functions (yours or Windows API ones, doesn't matter), then it simply puts function name in object file. Basically "this code calls function named X".
When linker creates executable (or dll) from object files, then it needs to know where are all the functions. If function X is in other object file, then linker puts call to its address. But when linker doesn't know where is X (like VirtualAlloc in kernel32.dll) then you need to specify import library. Those *.lib files are for linker to know which functions are in which dll files. Because it needs to generate code that inform OS than your exe/dll file will need function X in Y.dll file.
Using import libraries is perfectly fine and there really is no good reason to not to use them.
Thanks for the reply. I'm trying to explain that I want to use the import libs, however only specifying them on the command line like I've shown is not enough. I have copy + pasted out every symbol from Windows.h into a custom header, and have specified all required import libs on the command line (shown in original post), and still cannot properly link. Including Windows.h seems to signal to the linker some information somehow:
There are most likely lib statements that signal to the linker that a certain lib is needed.
So I'm asking, what do I need to do in order to compile + link without including Windows.h? I've searched inside of various Windows headers for "pragma comment", but cannot seem to find anything special. Perhaps MSVC is doing some special-case magic when compiling Windows.h. So, what additional steps should I be taking to properly use import libs for libraries like opengl32.lib, user32.lib, gdi32.lib, and kernel32.lib?