Static vs Dynamic Linking

This cluster debates the pros and cons of static versus dynamic linking in software compilation, particularly challenges with C/C++ libraries like glibc and GTK+, memory usage, dependencies, and feasibility for distribution.

➡️ Stable 0.5x Programming Languages
4,113
Comments
19
Years Active
5
Top Authors
#873
Topic ID

Activity Over Time

2008
3
2009
13
2010
31
2011
41
2012
105
2013
82
2014
183
2015
221
2016
242
2017
161
2018
216
2019
244
2020
426
2021
461
2022
443
2023
377
2024
439
2025
403
2026
22

Keywords

AFAIK RPATH hookrace.net dlang.org DRAM STL SDL nim.ht ABI OS linking statically static dynamic linked library libraries link dynamically glibc

Sample Comments

flohofwoe Aug 14, 2022 View on HN

Considering the complexity that shared libraries add over static linking: yes absolutely.

jkn Jul 3, 2012 View on HN

Static linking is not easily available with C/C++ in the general case. Some libraries support it, some important ones like Glibc and GTK+ do not.

aaomidi Feb 8, 2023 View on HN

Has static linking gone too far?

EugeneOZ Feb 22, 2015 View on HN

Isn't it possible to statically link C libraries too?

thomastjeffery May 19, 2023 View on HN

The standard library can be statically linked...

errordeveloper Jun 3, 2014 View on HN

Bare in mind it's statically linked also, so it doesn't need to read a bunch of dynamic libraries from disk.

JoachimSchipper Jan 13, 2016 View on HN

Linking everything statically is not always an advantage...

steveklabnik Jan 11, 2015 View on HN

You can't static link glibc, so our static binaries still have a dynamic dependency on it.

guappa Jan 19, 2024 View on HN

Then don't statically link? What's the problem?

T_S_ Sep 10, 2012 View on HN

Only as long as you use static linking.