C2447: Missing Function Header (Old-Style Formal List?) in Unreal Engine 5 (UE5 C++) – What It Means & How to Fix It
🧠 Why You’re Seeing This Error
The C2447
error means the compiler found a curly brace {
(starting a function body), but it didn’t see a proper function declaration before it. It might look like you’re writing a function, but you’re missing the return type, parentheses, or even the function name.
The message “old-style formal list?” refers to a really outdated C syntax, and it’s Microsoft’s way of saying:
“This doesn’t look like a valid C++ function declaration.”
In Unreal Engine 5, this often happens when:
- You forget
void
orint32
before a function name - You add
{}
directly after a variable or macro GENERATED_BODY()
orUFUNCTION()
is broken, which confuses the function parser
💥 Example Error Message
error C2447: '{' : missing function header (old-style formal list?)
🛠️ Example Code
void AMyActor::BeginPlay()
{
Super::BeginPlay();
InitLocation // ❌ C2447: missing function header
{
// Do something
}
}
✅ How to Fix C2447 UE5 – Step-by-Step
✔️ 1. Add the Missing Function Header (return type + parentheses)
Wrong:
InitLocation
{
// ...
}
Fix:
void InitLocation()
{
// ...
}
✔️ 2. Don’t Use Curly Braces With Variables or Macro Calls
This error can show up if you’re using {}
right after something that’s not a function.
Wrong:
FVector Location
{
0.f, 0.f, 0.f
}; // ❌ This looks like a function to the compiler
Fix:
FVector Location = FVector(0.f, 0.f, 0.f); // ✅ Correct constructor syntax
✔️ 3. Check for Broken Macros or Missing Semicolons
If a macro like GENERATED_BODY()
or a variable declaration is broken, it can mess up the parser for the next function.
Make sure:
GENERATED_BODY()
is present and correct- Every member ends in a
;
- You don’t have stray
{}
blocks
✅ Summary: How to Fix C2447 in UE5
Cause | Fix |
---|---|
Missing return type or () | Add function return type and parentheses (void MyFunc() ) |
Using {} after variable | Use = with constructor or proper initialization |
Broken macro or UFUNCTION | Check GENERATED_BODY() , UFUNCTION() , etc. |
Mistyped function body | Always use full header: ReturnType Name(Params) |