Some questions

I don't understand the concept of libraries and dll files....

for example, I was trying to use Opengl GLUT 3.7.6, I download the files needed to get started to programming with it... I got three files, glut.h, glut32.lib and glut32.dll....

I understand that glut.h is the header where all the classes, functions and constants are declared and defined...

What is a Object library file like the glut32.lib, and what is the purpose glut32.dll??
Simple: The classes, functions and constants are NOT defined in glut.h - they are only declared there. The definitions are in glut32.lib.

DLL's are used for dynamic links - instead including the definitions in the executable, they are loaded at runtime from the dll.

As an alternative, static linking is also possible, then the definitions will be included in the executable - but this will also increase the executables size.

Whether to use dynamic or static linking should be decided on a case by case basis.
thank you for clarifying..... Is the .lib file that contains the definitions already compiled or not? Can I check the source code written for each declaration given in the header file?

Ive read that there are two possibilities to use external libraries that either you are given files like those came with Opengl glut(a header file, a .lib file and a dll) or you are given the whole source code ( i guess in headers and their resource files) and you have compile them yourself....

Can you elaborate on that a bit more?
The libraries contain compiled code. If you were given a source code distribution, you would still use it as a library - you would just have to compile it once yourself first.
Topic archived. No new replies allowed.