grimgrom
grimgrom

Reputation: 780

Does dynamic libraries link other libraries for you?

I noticed how you don't have to link opengl32.lib by yourself when you use libraries such as SFML and I'm really wonder how that could be since I have to link opengl32 in my projects that are using my own multimedia library which is a static library? Is it simply because the SFML library is a dynamic library and opengl32 is linked in the SFML project? This is not a question about SFML, it's rather a question about all DLLs in general.

Upvotes: 0

Views: 59

Answers (2)

Niels Keurentjes
Niels Keurentjes

Reputation: 41958

Yes, DLLs can reference other DLLs, or statically compile them internally. To inspect external dependencies, Microsoft long ago developed a tool called Dependency Walker, in which you can drag a DLL or executable and see which DLLs it depends on (and thus are automatically loaded). The tool used to be shipped with Visual Studio by default, but you can now download it from here for free. That page kind of explains everything else about it.

Upvotes: 2

Mats Petersson
Mats Petersson

Reputation: 129314

If a dynamic library is using another dynamic library, it will automatically get loaded into the process, yes.

Upvotes: 1

Related Questions