As far as I know the .lib file is some sort of compiled file and of course the dll file contains all the functions in it anyway. Why can’t I just do with the .lib file or just the .dll file? Why do the instructions tell me to get all three of them?
By the way, are openGL files not free anyway that we have a “freeGLut”??
No, it’s not that simple.
A DLL is a executable binary, minus an startup entry point. The DLL exports some symbols, but those are featureless, only positions in the address space. A compiler can not deduce from a standard DLL (or SO) what signature each symbol has. For this it needs to be told the signatures in some way through an additional source. This is the header file (.h).
However to be actually usefull, the DLL must be loaded into the process upon execution. For this the executable needs to be augmented with additional information, namely what DLL(s) to load. Under Windows this is done using a stub library (.lib), that merely carries that DLL import information. On other OSs you link against the “DLL” by pointing the linker to that one.
Because the .lib doesn’t contain actual code but only the information, to use a certain DLL. And because the Microsoft tools can’t pull their dynamic linkage information from the target DLLs.
Because each file has a specific function, and you need all three of them to
GLUT is not part of OpenGL. It’s a independently developed library. Also OpenGL itself is just a specification and there are no “the” OpenGL sources; there are only particular implementations, of which some are free.