E2316
C++ Builder Programming Language
Severity: MinorWhat Does This Error Mean?
E2316 means you tried to access a member function or data member that simply does not exist in the class the compiler knows about. The message reads: E2316 'member' is not a member of 'class'. The most common causes are typos (C++ is case-sensitive), using a pointer to a base class instead of the derived class, and including the wrong version of a header.
Affected Models
- C++ Builder 10.x (Alexandria)
- C++ Builder 11 (Sydney)
- C++ Builder 12 (Athens)
- RAD Studio 11 and 12
Common Causes
- Typo in the member name — ShowModal and showmodal are different identifiers
- Calling a method that belongs to a derived class through a base class pointer
- A VCL component property or method that was renamed in a newer C++ Builder version
- Using the wrong class in a template instantiation
- The member was conditionally compiled out by a preprocessor directive
How to Fix It
-
Check the exact spelling and case of the member name. Open the class definition in the IDE or the VCL help and confirm the member exists with that exact name.
In C++ Builder IDE, right-click the class name and choose Open Source to see its full definition. Code completion (Ctrl+Space) lists all available members for the type.
-
If the member belongs to a derived class, ensure your pointer or variable is declared as the derived type. Cast or redeclare as needed.
A TControl* only exposes TControl members. Cast to the specific component type (TButton*, TEdit*, etc.) to access its unique properties and methods.
-
If the error appeared after upgrading C++ Builder, look up the member in the migration guide. Some VCL properties and methods were renamed or moved between versions.
Embarcadero publishes migration guides for each major C++ Builder version. The old member name is often mentioned alongside the replacement.
Frequently Asked Questions
Why does E2316 appear for a VCL property I can see in the Object Inspector?
The Object Inspector shows design-time properties, some of which are implemented through __published macros or special VCL mechanisms. If you try to access the property in code using a base class pointer instead of the specific component type, the compiler does not see it. Always use the correct component type in code.