Jump to content
  • Advertisement
Sign in to follow this  
lord_buctree

What do you use DLLs for.

This topic is 4965 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

Advertisement
Dynamic Linked Libraries are the opposite of Static Linked Libraries. They are commonly used to hold code that is frequently updated and does not need to be fast. I would personally not recommend using DLL files in a game but instead in a Windows Application. DLL file will allow you to update the program without recompiling the whole Executable. The executable files are almost identical in file structure to DLLs however DLLs do not have a main function. The Linux alternative to dynamic libraries are SO files.

This website should give you a good idea of what they are:
http://www.geocities.com/sujitmanolikar/dllhowto.html

Hope that helps~ John DiSanti

Share this post


Link to post
Share on other sites
DLL's are used for a few different reasons.

One is a compiled C++ DLL is much faster than VB (visual basic) any day, so that can have some good effects.

DLL's can also be part of larger libraries that dont give out their source code, but will give you a compiled DLL to use (such as SDL, OpenGL, and DirectX, to name a few).

Third, and more personal use, of a DLL is to share commonly used code among different programs.

Hope that makes sense
~zix~

Share this post


Link to post
Share on other sites
Quote:
Original post by disanti
The executable files are almost identical in file structure to DLLs however DLLs do not have a main function.


they are identical to executable files (Portable Executable), the only difference is the extension and the way you use them.
They do have a main function, its called DllMain, though you can write a DLL without specifying one, in which case you get a stub.

*nix shared objects are different thought.

Share this post


Link to post
Share on other sites
Quote:
they are identical to executable files (Portable Executable), the only difference is the extension and the way you use them.
They do have a main function, its called DllMain, though you can write a DLL without specifying one, in which case you get a stub.


Hmmm... I've made so few DLLs, I had no clue they had a main function. I have never used it.

Share this post


Link to post
Share on other sites
Hmm, I never knew DLL's to be slower. Can anyone explain why that is? I realize loading them takes time, but after that, isn't it just executable code, like any other?

Share this post


Link to post
Share on other sites
Quote:
Original post by Spoonster
Hmm, I never knew DLL's to be slower. Can anyone explain why that is? I realize loading them takes time, but after that, isn't it just executable code, like any other?


The reason they are slower is because the computer has to find the address of the functions it is using from a virtual table in the .DLL. I don't think that the .dll perfomance hit in execution is significant to discourage its use. I'm working on my Game Engine and it is a .dll and it runs just as good as the whole project compiled. But since there is more overhead when using .dlls, thats where a speed hit is from. Hope this helps!

PS - Making dlls aren't that hard anymore, you just have to do a few easy steps and that's it. The trouble comes when you need to share data across multiple programs or you need to use STL...then the fun begins.

Share this post


Link to post
Share on other sites
Quote:
Original post by Drew_Benton
PS - Making dlls aren't that hard anymore, you just have to do a few easy steps and that's it. The trouble comes when you need to share data across multiple programs or you need to use STL...then the fun begins.


How is STL an issue? Also, i've had trouble trying to share data across multiple dll's... is there a standard method to handle that?

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
Quote:
Original post by Drew_Benton
The reason they are slower is because the computer has to find the address of the functions it is using from a virtual table in the .DLL. I don't think that the .dll perfomance hit in execution is significant to discourage its use. I'm working on my Game Engine and it is a .dll and it runs just as good as the whole project compiled. But since there is more overhead when using .dlls, thats where a speed hit is from. Hope this helps!


The address only has to be resolved once, this is something you want to do when your program loads. After that, you can store a pointer to the function and its not slower to call the DLL function than calling a virtual function on an object in C++.

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.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!