Main Content

Build MATLAB Interface to C++ Library

To create a MATLAB® interface to a C++ library, use the MATLAB clibgen namespace

To build (publish) a MATLAB interface to a C++ library, call clibPublishInterfaceWorkflow. For an overview, see Steps to Publish a MATLAB Interface to a C++ Library.

For information about calling functions in the library from MATLAB, see Use Prebuilt MATLAB Interface to C++ Library.

Functions

clibPublishInterfaceWorkflowPublish interface for C++ library in the Live Editor (Since R2023a)
clibgen.generateLibraryDefinitionCreate definition file for C++ library
clibgen.buildInterfaceCreate interface to C++ library without definition file

Live Editor Tasks

Generate C++ InterfaceGenerate definition file for C++ interface library in the Live Editor (Since R2023a)

Namespaces

clibgen NamespaceSummary of namespaces and classes to support calling C++ library functionality from MATLAB

Topics

How To Publish an Interface

Publish Interface to Libraries Defined by These Files

Share Your Interface

Troubleshooting

Build C++ Library Interface and Review Contents

If library functionality is missing, the library might contain unsupported language features or data types.

Limitations to C/C++ Support

C/C++ library features not supported in MATLAB.

Troubleshooting C++ Library Definition Issues

Information for resolving errors when publishing a MATLAB interface to a C++ library.

Troubleshooting MATLAB Interface to C++ Library Issues

MATLAB searches for the library interface file on the MATLAB path.

Debug C++ Library from MATLAB Interface

How to build a debug version of a MATLAB interface to a C++ library.