autofix-undeclared-identifier
Fixes 'undeclared identifier' errors by adding missing
Instalar con Codex o Claude Copia este prompt, pégalo en Codex, Claude u otro asistente, y deja que revise la página de la skill y la instale por ti.
Menú
Fixes 'undeclared identifier' errors by adding missing
Instalar con Codex o Claude Copia este prompt, pégalo en Codex, Claude u otro asistente, y deja que revise la página de la skill y la instale por ti.
Basado en la clasificación ocupacional SOC
Comprehensive build error repair tool for C++, Rust, and Java projects using Soong, GN, Make, or CMake. Automatically fixes 30+ types of errors including headers, linking, APIs, and config.
Fixes function call errors with wrong number or type of arguments.
Fixes type mismatch errors by adding appropriate casts or conversions.
Fixes syntax errors in Android.bp files.
Removes unsupported or unknown compiler flags from build configurations.
Fixes scope and variable errors in BUILD.gn files.
| name | autofix-undeclared-identifier |
| description | Fixes 'undeclared identifier' errors by adding missing |
Fixes errors where a symbol is used but not declared in the current scope.
use of undeclared identifier 'X''X' was not declared in this scopeerror: 'X' undeclaredParse the error message to extract the undeclared identifier.
Common C++ standard library symbols:
| Symbol | Header | Namespace |
|---|---|---|
vector | <vector> | std:: |
string | <string> | std:: |
cout, cin, endl | <iostream> | std:: |
map, unordered_map | <map>, <unordered_map> | std:: |
unique_ptr, shared_ptr | <memory> | std:: |
thread, mutex | <thread>, <mutex> | std:: |
LOG, ALOG* | <android/log.h> | - |
If not a standard symbol, search the codebase:
grep -r "class X" --include="*.h"
grep -r "struct X" --include="*.h"
grep -r "#define X" --include="*.h"
Add the appropriate #include at the top of the file:
#include <vector> // For std::vector
#include "project/MyClass.h" // For project symbols
Or add namespace qualifier:
std::vector<int> items; // Instead of: vector<int> items;