DEV Community

Selfish Dev
Selfish Dev

Posted on

1 1 1 1

What is Dynamically Linked Library

WHAT

A Dynamically Linked Library (.dll) (on Windows) or Shared Library (.so) (on Linux) is a file that contains reusable code that programs can load while running, instead of being included inside the program itself.

(Think of it like the preload()function in Godot.)

EXAMPLE

Imagine you're developing a game using SDL and you compile your code like this:

g++ sdl.cpp -o sdl -lSDL2
Enter fullscreen mode Exit fullscreen mode

Every time you update your code, you must recompile the entire program. This is time-consuming and frustrating, especially for large projects.

Instead, we can divide our game into multiple DLLs.

By moving different parts of the game (like physics, audio, and rendering) into separate DLLs, you can update only those parts without recompiling the entire game. Once the DLL is updated, your main sdl.cpp file automatically picks up the changes.

its literally like a magic

Benefits

  • Smaller programm
  • Easy to update
  • Reusable

Hostinger image

Get n8n VPS hosting 3x cheaper than a cloud solution

Get fast, easy, secure n8n VPS hosting from $4.99/mo at Hostinger. Automate any workflow using a pre-installed n8n application and no-code customization.

Start now

Top comments (0)

👋 Kindness is contagious

Engage with a wealth of insights in this thoughtful article, valued within the supportive DEV Community. Coders of every background are welcome to join in and add to our collective wisdom.

A sincere "thank you" often brightens someone’s day. Share your gratitude in the comments below!

On DEV, the act of sharing knowledge eases our journey and fortifies our community ties. Found value in this? A quick thank you to the author can make a significant impact.

Okay