Main Content

Header-Only HPP File

This example creates a MATLAB® interface to a C++ library named school. The library is defined in the header file school.hpp and does not have a compiled library file. A library defined completely by its header file is called a header-only library.

Library ArtifactsMATLAB Package libnameMATLAB Help

Header file school.hpp

clib.school (default name)

>> doc clib.school

This library defines classes representing students and teachers. After you publish this library, MATLAB users can call functions in the clib.school package to create Student and Teacher objects and specify names and ages.

MATLAB provides the header file for you to use in this example in this folder:

fullfile(matlabroot,"extern","examples","cpp_interface");

Use these steps to create a school interface for Windows®.

Related Topics