"It's even possible to write something like an Apache-2.0 licensed crate that links to a GPL-2.0 licensed crate, resulting in a situation where you cannot distribute any binaries built from them."
Deep, long, very tired sigh.
seen from Russia

seen from United States
seen from United States

seen from United States
seen from China
seen from China

seen from Netherlands
seen from China
seen from Italy

seen from Türkiye

seen from Czechia
seen from Czechia

seen from United Kingdom

seen from United Kingdom
seen from United States
seen from China
seen from Türkiye
seen from China
seen from Ghana
seen from India
"It's even possible to write something like an Apache-2.0 licensed crate that links to a GPL-2.0 licensed crate, resulting in a situation where you cannot distribute any binaries built from them."
Deep, long, very tired sigh.

Anya is live and ready to show you everything. Watch her strip, dance, and perform exclusive shows just for you. Interact in real-time and make your fantasies come true.
Free to watch • No registration required • HD streaming
There's this idea that dynamic linking is better than static linking because it means you can get things like security upgrades in the libraries without having to recompile and reinstall the binaries that use them, and also because it means space savings, and so on.
I've been thinking about this on and off for years, and it seems a tad stale - wisdom from an earlier time which does not apply as much anymore.
If we assume someone has to manually compile every binary from source, that fits. This is the one situation in which I personally felt that benefit. When I was manually going through the cycle of download -> `./configure ...` -> `make` -> `sudo make install` and so on for a bunch of software on the Nokia N900. I learned a lot from this, but otherwise I'd say it was a waste of my precious finite life. If I had to recompile everything again for a fix to my libc or TLS libraries or something else that was used by a bunch of software, I'd have a bad time. Similarly, on that weak low-powered hardware, it would take a lot of time.
But let's assume proper automation. Let's assume that installing upgrades is a matter of running a single command, or even entirely automatic. As it is already for most users on most systems. In that case, static inclusion of libraries doesn't get in the way of upgradability from a manual effort perspective. All the binaries that use the library can be rebuilt.
Let's assume a typical system where a trusted build server does the builds, and most devices download pre-built libraries from those servers. As it is already with most package managers on most systems that most users have. Then static inclusion of libraries into binaries doesn't even affect upgrade time much, because the rebuilding of all those binaries that use a library is amortized and done out-of-band by the build system.
Let's assume some modest optimizations: static linking doesn't have to include the whole library - it can include just the parts that are used; whole program optimization means that those included parts might be inlined and simplified to just the cases in the logic that are actually used; if after all that there is still a lot of identical library code in binaries, downloads can use compression over all the binaries together. So static inclusion of libraries doesn't have to substantially increase download sizes for installs and upgrades.
(If it is commonly the case that large chunks of code are frequently duplicated between binaries, we can even design a package system where those duplications are detected and recorded, so the package manager doesn't have to download those chunks of a binary if it knows that it can copy it from another binary that is already locally available. I don't know how often this is an optimization worth making, but if I had to guess, you'd have large duplications in multiple binaries of code from libraries implementing network protocols, cryptography, and GUI frameworks - code which is complex or has to handle a lot of possible situations from the external world.)
Disk and memory space tends to be huge nowadays, so even if after whole program optimization programs are still big, that's not the same dire problem it once was. If benchmarking proves that it is, however, then splitting into dynamic libraries can be a separate optimization step! Tooling could identify common chunks of code in multiple statically compiled libraries, and pull them out into common files which are then dynamically linked at runtime.
Meanwhile, reproducible builds and stable behavior are a thing people value a lot nowadays. You know what really sucks? Having something break or behave differently because a dependency got upgraded or a different version got installed or the build options were different or whatever. This is true for dynamically linked libraries too. Look at package systems like Nix. Look at containerization systems like Docker. Look at application distribution systems like Flatpak. These things exist in large part to provide stable, exactly reproducible bundles of all dependencies. And if every app is bundling its own dynamically linked copy of typical libraries anyway, then the dynamic linking isn't getting you anything, except perhaps easy hooks for intercepting or redirecting calls across library boundaries, but during development there are easier ways to debug and if you want that feature in production that's the kind of thing that could be solved by a build-time step adding code to make it happen. If you embrace the wisdom of immutable dependency graphs, or want perfectly reproducible builds and executions, then static linking is more aligned with that than dynamic linking.
Visual Studio DLL Static Linking
In Visual Studio, go to the project Properties.
Change Configuration to Release.
Go under Configuration Properties | C/C++ | Code Generation
Look at the Runtime Library setting. If it's set to: Multi-threaded DLL (/MD) Change it to: Multi-threaded (/MT)
Rebuild.