Why #include "functions.c" Breaks Your C Build
A beginner C tutorial explaining why including .c files in main.c compiles but causes duplicate symbols and broken builds, and what to do instead.
Radar snapshot
No product or monetization exists behind a tutorial, so business model conviction is minimal. It is still practically useful to indie devs writing C/C++ who want to understand the compiler/linker separation quickly. How we score
Business breakdown
This is an educational dev.to article, not a product, so there is no monetization model — the value is in audience building and developer credibility for the author. Target users are C beginners and self-taught systems programmers hitting linker errors. The market opportunity is indirect: content like this drives traffic, newsletter signups and reputation rather than revenue.
Use it if…
Self-taught developers and CS students writing their first multi-file C project who keep hitting multiple-definition linker errors.
Skip it if…
Experienced C/C++ engineers who already know the translation-unit and header-guard rules — nothing new here.
Alternatives & competitors
| Option | Positioning | Pricing |
|---|---|---|
| Compiler/linker docs and textbooks | Authoritative and complete, but slow to read when you just want the answer to one error. | Free (docs) to paid (books) |
| Stack Overflow answers | Faster to find for a specific error message, but scattered and often outdated. | Free |
What an indie dev can do with this
- Put function declarations in a .h file and definitions in a .c file, then include only the header.
- Guard every header with #ifndef/#define/#endif or a single #pragma once to prevent double inclusion.
- When the linker reports duplicate symbols, check for #include of .c files or missing guards before anything else.
FAQ
- Is it ever acceptable to #include a .c file?
- Only in narrow cases like single-file libraries, generated code or unity builds where you compile exactly one translation unit — never in normal multi-file projects.
- Why does the code compile but fail at link time?
- The compiler sees valid definitions in every translation unit, but the linker finds the same symbol defined more than once and rejects it.