C++: error: 'void D::f()' marked 'override', but does not override
A method has override, but no virtual function in the base class has exactly that signature.
marked 'override', but does not overridemarked override but does not overridemethod with override specifier did not override Meaning
A tiny signature difference — const, parameter type, reference, or name spelling — makes it a new function instead of an override. override turns that silent bug into an error.
Common causes
- Missing or extra
const - Parameter types differ (int vs long)
- Base method not virtual
- Misspelled name
⚡ Quick fix
- Make the signature identical to the base
- Declare the base function
virtual - Remove
overrideonly if you intend a new function
Detailed fix by platform
GCC / Clang
- Compare declarations side by side; use
-Woverloaded-virtualto see hidden functions
Code examples
const mismatch
struct Base { virtual void draw() const; };
struct Derived : Base { void draw() override; }; // error: marked 'override' but does not override (missing const)How to diagnose
- Signature — Same params, const, noexcept?
- Virtual — Base virtual?
- Name — Spelling?
🔧 Still not fixed?
Many errors look alike. If the steps above didn’t solve it, one of these is probably what you’re facing:
Similar errors
- C2259 MSVC: error C2259: 'X': cannot instantiate abstract class
- cannot bind non-const lvalue reference C++: error: cannot bind non-const lvalue reference of type 'T&' to an rvalue of type 'T'
- cannot declare variable to be of abstract type C++: error: cannot declare variable 'x' to be of abstract type 'Shape' (pure virtual functions)
Most viewed in C/C++
- AddressSanitizer: heap-use-after-free C/C++: ==ERROR: AddressSanitizer: heap-use-after-free on address — memory used after delete/free
- AddressSanitizer: heap-buffer-overflow C/C++: ==ERROR: AddressSanitizer: heap-buffer-overflow on address — READ/WRITE of size N
- Bus error C/C++: Bus error (core dumped) — SIGBUS from misaligned access or a bad memory-mapped file
Other ways to find it
Where this error sits
Origin: Application & API. Errors that are often confused with or caused by this one (click to open):
🧠 Still stuck? Analyze your error
Paste the full message, response headers or stack trace — we'll detect the platform and point to the most likely cause.
💬 What worked for others
No tips yet — did something else fix this for you?
Share what worked for you
Tips are checked by an editor before they appear. Links are removed.
Report a correction or suggest an improvement
Last updated 28 Nov 2026