Informix Error -4016: Each class declaration must have at least one member function.
Cause and resolution
Each class declaration must have at least one member function.
This class declaration contains no member functions. A class must contain at least one, because the point at which the first (or only) member function is defined is also the point at which the class itself is defined. If the class has no other members, declare its constructor function. Because the constructor is declared, it must also be defined (although the definition need not contain any statements beyond FUNCTION and END FUNCTION unless you wish).
Oninit® Troubleshooting Guidance
Reasons / Common Causes
-4016 fires when a CLASS declaration contains no member functions at all — per the official
guidance, a class must contain at least one, because the point where the first (or only)
member function is defined is also where the class itself is defined.
- A class declaration with no member functions, per the official guidance — the direct, only cause.
Solutions / Resolution
- If the class has no other members, declare its constructor function, per the official
guidance — the definition doesn't need statements beyond
FUNCTION/END FUNCTIONunless desired.
Examples
A class with no member functions
CLASS Marker
DEFINE flag SMALLINT
END CLASS
-- -4016: Marker has data but no member function
Corrected
CLASS Marker
DEFINE flag SMALLINT
FUNCTION Marker()
END FUNCTION
END CLASS
Diagnostic Checks
- Check every class declaration for at least one member function, adding an empty constructor if none is otherwise needed.
Related Errors / Related Topics
No closely related error codes are cross-referenced for -4016 in this set yet.
A class declaration has no member functions — add at least a constructor, even an empty one.