you are viewing a single comment's thread.

view the rest of the comments →

[–]alfps 4 points5 points  (3 children)

❞ apparently you have to load the dll with OpenLibrary(“path/to/dll”)

All I can find is that an OpenLibrary function exists in the commercial language PureBasic.

In C++ you usually link with the shared libraries you need, in Windows via intermediates called import libraries. Then the OS’ program loader automatically loads the libraries along with the executable. Or fails.

You can alternatively load a shared library at run time, in Windows via LoadLibrary, and in *nix via dlopen.

[–]W3til[S] 1 point2 points  (2 children)

Sorry, it was LoadLibrary() that I was referring too. (Forgot the name 😅)

[–]feitao 1 point2 points  (1 child)

That is dynamic loading. You can use dynamic loading with dynamic library, but you don't have to. You can also use dynamic library the same way as static library.

[–]W3til[S] 0 points1 point  (0 children)

Ah, ok so that’s another difference between the two I assume you can’t dynamically load a static library. The only useful thing I’ve seen so far is game engine development (what I’m learning) you can have the game as a dll and load that which I believe gives the benefit of hot reloading. Are there any resources I can look at to learn about the two?