In c::b you can create dynamic, static and shared libraries. Firstly, I thought a dynamic library was a shared library so why is there two different options in c::b (A.1 — Static and dynamic libraries « Learn C++).


So, on compiling a dynamic dll, say myDll you get, myDll.dll, libmyDll.a and libmyDll.def. Why do we need the libmyDll.a, I thought this extension was a static library, and also why do we need the myDll.def. These are the definitions of the functions in the dll i know, is this needed when using loadlibrary(), I don't ever use a def file so what's point of it?. Can you not use load library without a .def, or when is the .def actually needed? Is this the same for the MSVC compiler?


Now when compiled, a static library gives, dllmyStatic.a. That makes sense to me, you can link and use the functiers etc in your program and the whole library is integrated into you program regardless of the functions you are using.


Now a compiled shared library seems to give the same as a dynamic dll, libMyshared.dll, libMyshared.def and libMyshared.a.


I understand how to use a function from a dynamic library using loadlibrary(). I understand how to use a static library by linking it in the IDE and using the headers and then the functions are available to be called. I don't see the difference between a dynamic dll and shared dll in c::b though. Nor do I see the need for 3 files, .dll, .a and .def to be produced from both dynamic and shared libraries. Any tips here?