MSVC build errors > C4430
C4430: missing type specifier
error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
The compiler expected a type and did not find one. Most often, a type name is unknown at that point, and C2143 or C2061 errors come with it.
Causes and fixes
- The type is not declared yet. Include the header that declares it, before the line that uses it.
- Two headers include each other. With a circular include, one class is not declared when the other uses it. Replace the include with a forward declaration (
class Widget;) where a pointer or a reference is enough. - A function has no return type. Write it, for example
voidorint: C++ has no defaultint. - The type is in a namespace. Qualify it, for example
std::string.
Fix C4430 with CppPilot
CppPilot reads the error, your code, and the project settings Visual Studio evaluates for the active configuration, then explains which of these causes applies. Choose Fix and the AI corrects it; CppPilot rebuilds the project and checks that the error is gone. Every change appears in Visual Studio for your approval.
Let the AI fix it in Visual Studio
CppPilot is a free extension that explains and fixes MSVC build errors with Codex, Claude, or CppPilot Cloud.
Related errors: C2065, C2011. See all guides.