Informix Error -4068
-4068 Function "class::member" has not been declared as SHARED.
This statement uses the double-colon syntax to invoke a class-member function. However, the specified member function was not declared as SHARED. Only shared member functions can be called this way; normal member functions must be called through a reference to an object because they need the object reference as the value of their SELF reference. Check that you have specified the class and member that you intended; then review the declaration of that class.
Oninit® Troubleshooting Guidance
Reasons / Common Causes
-4068 fires when the class::member double-colon syntax is used to invoke a member function
that isn't SHARED — per the official guidance, only shared member functions can be called
this way; normal member functions must be called through an object reference, since they need
that reference as their SELF value.
- A non-
SHAREDmember function invoked viaclass::membersyntax, per the official guidance — the direct, only cause.
Solutions / Resolution
- Check that the class and member specified were the ones intended, per the official guidance.
- Review the declaration of that class, per the official guidance — if the function
genuinely needs to be called this way, declare it
SHARED; otherwise call it through an object reference.
Examples
Calling a normal member function via ::
CALL Order::save()
-- -4068: save() is a normal member function, not SHARED
Corrected, calling through an object
DEFINE o Order
CALL o.save()
Diagnostic Checks
- Check whether the called member function is declared
SHARED, and either addSHAREDor call it through an object reference instead.
Related Errors / Related Topics
- -4069 — "The type of expression on which member function "name" is called is not a
class." A related member-call error, about the left-hand operand not being a valid
class/object reference at all, rather than a valid class whose member isn't
SHARED.
class::member syntax was used on a non-SHARED member function — declare it SHARED, or
call it through an object reference.