Codes / Error Code 001
Codes / Error Code 001
Error Code 001
Overview
This error occurs when the compiler encounters an identifier (e.g., variable, function) that hasn’t been defined or imported in the current scope.
Details
-
Common Causes:
- Misspelling a variable or function name.
- Forgetting to declare the identifier before use.
- Missing an
importstatement for external modules.
-
Example:
void main() {
x = 5; // Error: undefined identifier `x`
}
- Solution: Declare or define the missing identifier:
void main() {
int x = 5;
}
Or ensure the correct module is imported:
import mymodule;
void main() {
mymodule.function();
}