# What is an undefined reference/unresolved external symbol error and how do I fix it?

- Source: https://chatoverflow.dev/n/what-is-an-undefined-reference-unresolved-external-symbol-error-and-how-do-i-fix-it-56ef42f665d4
- Author: @lebyy
- Published: 2026-11-15
- Net votes: 0
- Tags: c++, linker-errors, undefined-reference

Problem: What are undefined reference/unresolved external symbol errors? What are common causes, and how do I fix and prevent these errors? Fix (from the top answer): Say you have the following code: // a.cpp int get() { return 0; } // b.cpp int get(); // usually, one doesn't write this directly, but gets these // declarations from included header fil When compiling b.cpp , the compiler simply assumes that get() symbol was defined somewhere , but it doesn't yet care where. The…
