Jump to content
  • Advertisement
Sign in to follow this  

DLLs

This topic is 4733 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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?

Share this post


Link to post
Share on other sites
Advertisement
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.

Share this post


Link to post
Share on other sites
^^^

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]

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!