Limitations to C/C++ Support - MATLAB & Simulink (original) (raw)

Main Content

You can create a MATLAB® interface to 64-bit compiled libraries based on C++98 and commonly occurring C++11 features. However, if a library contains the following data types or language features, then the functionality is not included in the MATLAB interface to the library. You might be able to include this functionality by creating a wrapper header file. For more information, see C++ Limitation Workaround Examples.

Data Types Not Supported

Messages About Unsupported Types

If a library uses these data types, then the functionality is not included in the MATLAB interface to the library, and MATLAB displays messages like:

Did not add member 'methodName' to class 'ClassName' at HeaderFile.h:290.   'long double' is not a supported type.

To view these messages, use the Verbose option in the clibgen.generateLibraryDefinition or clibgen.buildInterface functions.

Language Features Not Supported

When you build a library containing these features or usage, MATLAB displays:

Warning: Some C++ language constructs in the header file are not supported and not imported.

Note

Saving C++ objects into a MAT-file is not supported.

Inheriting C++ class in MATLAB

MATLAB does not support creating MATLAB classes that inherit a C++ interface class.

Unsupported Class Methods

MATLAB does not support implementing operators by defining these associated functions.

Operation Method to Define
a(s1,s2,...,sn) subsref(a,s)
a(s1,...,sn) = b subsassign(a,s,b)
b(a) subsindex(a)

See Also

Topics