Informix Error -4011: Class "name" is not declared.
Cause and resolution
Class "name" is not declared.
This statement refers to a class of the indicated name, but no such class has been declared to this point in the source module. Check the spelling of the name. Make sure that all desired include files have been included.
Oninit® Troubleshooting Guidance
Reasons / Common Causes
-4011 fires when code references a class name that hasn't been declared anywhere earlier in the source module — per the official guidance, no such class has been declared to this point.
- A misspelled class name, per the official guidance — the first named cause.
- A missing
INCLUDEfor the file that declares the class, per the official guidance — the second named cause.
Solutions / Resolution
- Check the spelling of the class name, per the official guidance.
- Make sure all desired include files have been included, per the official guidance.
Examples
A missing include for a class definition
DEFINE o OrderClass
-- -4011: OrderClass is declared in orderclass.4gl, which wasn't INCLUDEd
Corrected
INCLUDE "orderclass.4gl"
DEFINE o OrderClass
Diagnostic Checks
- Check the class name's spelling, and confirm the file declaring it has been
INCLUDEd before this point in the module.
Related Errors / Related Topics
- -4010 — "Include file "pathname" is not found." A related compile-time error, about an
INCLUDEstatement itself failing, which can be the root cause of a class appearing undeclared here.
A referenced class hasn't been declared — check its spelling and whether its defining file was included.