In general, I connected the dynamic library.
Static is a collection of * .obj-files of the library in * .lib, which we can, by specifying the linker, attach to our program at the time of compilation. The contents of the library, as always, are described in headers that are distributed with * .lib. At the output we get a single executable file of your program (.exe). And still static libraries increase the size of a code in a binary format. They are always loaded, and any version of the code you compiled is the version of the code being run: 3.
Dynamic linking is performed by the platform (operating system) in the process of the program. We still have the * .lib and * .h files in our hands, however, now .dll ( .so for Linux) is added to them. * .lib-file now contains only calls to * .dll, where the algorithms are located directly and which are called on the fly and not compiled. Because now we have * .exe + * .dll. Several programs can use one * .dll at the same time, thereby not occupying the RAM in identical pieces and the programs themselves are smaller. For example, many drivers and graphics libraries (DirectX and OpenGL) work. However, now this is not such an actual problem, they draw the disadvantages - incompatibility of versions, lack of necessary libraries, hell of dependencies for installing applications (working in Linux with the Gnome graphical environment (based on GTK + library) if you download the tiny text editor Kate for GOD KDE (based on Qt), then you have to pull this very Qt by tens of megabytes). Therefore, now they recommend not to get involved in dynamic linking and try to link programs statically. Yes, and * .dll will have to carry with you: 3
That's where I read it.