MATLAB Compiler | ![]() ![]() |
C++ Libraries
The intent of the C++ library wrapper files is to allow the inclusion of an arbitrary set of M-files into a library. The header file contains all of the entry points for all of the compiled M functions.
Note Even if you are not producing a separate library, you must generate a library wrapper file when including any Compiler-generated code into a larger application. |
This example uses several functions from the toolbox\matlab\timefun
directory (weekday
, date
, tic
, calendar
, toc
) to create a C++ library called libtimefun
. The -W lib:libtimefun -L Cpp
options produce the C++ library files shown in this table.
File |
Description |
libtimefun.cpp |
C++ wrapper file |
libtimefun.hpp |
C++ header file |
libtimefun.cpp
The C++ wrapper file (libtimefun.cpp
) initializes the state of Compiler-generated functions so that those functions can be called from C++ code not generated by the Compiler. These files are produced from the command
or using the cpplib
bundle file
![]() | C Shared Library | COM Components | ![]() |