Build C++ Library Interface and Review Contents

Note

If library functionality is missing, the library might contain unsupported language features or data types. For details, run clibgen.generateLibraryDefinition with the 'Verbose' option set to true.

Build From Library Definition File

If you created a .mlx library definition file using the clibgen.generateLibraryDefinition function, then use the build function. For example, for library definition file definelibName, type:

build(definelibName)
addpath libName

Display the functionality in the library.

summary(definelibName)

One-Step Build

If your library does not contain pointers or other constructs that require definition, you do not need to create a definition file. Call clibgen.buildInterface directly on the C++ header and library files. For example, to build library libName defined by header file header.hpp, type:

clibgen.buildInterface('header.hpp','Verbose',true)
addpath libName

Review Contents of Interface

MATLAB® automatically copies some C++ comments, if available, from the header and source files into the interface. You can modify or replace this content. For more information, see Publish Help Text for MATLAB Interface to C++ Library.

Use the doc function to open the Help browser which provides links to display help for library functionality. For example, to verify the included classes for library libname, type:

doc clib.libname

Click a link for a class. MATLAB opens a new tab. To display help for class ClassName, click the Constructor Summary link and verify the content. Click the Property Summary links. Scan the Method Summary for clib.libname.ClassName methods.

See Also

|

Related Topics