News for hackers. Stuff that matters.
Re:Building and Linking Libraries in C by pjc50 on Friday December 23, 2016 @07:04AM (#13244349)
If you put a bare function or variable in a header, then use it in multiple compilation units, the linker will reject your multiply-defined symbols.

(Templates get de-duplicated).

Re:Building and Linking Libraries in C by vonmoltke on Friday December 23, 2016 @07:25AM (#13244412)
Unless you mark them 'static', which is common practice for constants and small inlined functions.
Re:Building and Linking Libraries in C by gpderetta on Friday December 23, 2016 @09:27AM (#13244841)
Inline is the keyword here (litterally). Inline, in C++, is defined as disabling the requirement of having exactly one definition of a function (it is also a weak hint for the compiler to perform inlining).

Template functions are implicitly inline.

Inline in C has a similar but subtly different definition.