DLLs

Started by
4 comments, last by Strewth 18 years, 10 months ago
what exactly is a dynamic link library? how does it relate with a "static library"(i saw this under new project in devcpp) and a header file?
Advertisement
http://en.wikipedia.org/wiki/.dll
[size="1"]
In short, i like to think of it as a file that containes code (it's compiled already in a .dll) - and you can use that in your linked program.

For example, if you use the opengl function glEnable();, this function, or more what it actually does in code, is contained in the OpenGL32.dll file. Sorta like a CPP file in a class, except it is compiled code (im not sure what they call that?).

When you use a .dll, any program can use that if they link to it. With opengl, this is done by linking OpenGL32.lib..and you include the header file for compile purposes...for example.
gib.son
^^^

Yea, in short its a library of compiled functions that any program can 'link' to. In other words; Any program can call up and use the compiled function from the library, at the same time, as if it were written into the programs execute.

muh, I just confused myself [smile]
what I think of .dlls and .libs are that with .lib you dont have to have the library on the computer you run the program, like a header file. using a static library, a folder with the program might be like this:
A folder named "mainfolder"
An exe for the game in mainfolder
a folder in mainfolder named "graphics"
.bmps in graphics

But with a DLL(dynamic linked library) it will be this:
A folder named "mainfolder"
An exe for the game in mainfolder
A DLL in mainfolder named "mainlib"
a folder in mainfolder named "graphics"
.bmps in graphics
[EDIT]
oops. Misunderstood the questions. heres the answer to the question:
A header file you created has a class, and some functions in it.
You realize that you cannot put the definitions in the header file, so you make a .cpp file for that.
You say to yourself, "what I need is some file that I can use so I dont have to include the .cpp every time", so you make a library.
I program in my sleep,but when I sleep I use the partition in my head that doesnt have g++ or the .net library, so im kinda screwed.
Well, a .lib is still gonna end up being "included" each time. Its linked into the executable at compile time (hence the static term). Whereas the .dll is external to your executable and is dynamically linked at run time.
Blake's 7 RPG - a new project

This topic is closed to new replies.

Advertisement