C/C++ Shared Library Integration

Integrate compiled MATLAB® functions into C or C++ applications

Integrating compiled MATLAB functions into a C or C++ application requires you to use a combination of APIs. MATLAB Compiler SDK™ uses APIs to initialize the MATLAB Runtime, load the compiled MATLAB functions into the MATLAB Runtime, and manage data that is passed between the C or C++ code and the MATLAB Runtime. The compiler generates some of the APIs based on the signatures of the compiled functions. MATLAB Runtime provides other APIs that are consistent for all applications.

To integrate MATLAB functions with your application code see Call a Shared Library.

Functions

mbuild Compile and link source files against MATLAB generated shared libraries

C/C++ API

mclmcrInitialize Initializes the MATLAB Runtime proxy library
mclInitializeApplication Set up application state shared by all MATLAB Runtime instances created in current process
mclTerminateApplication Close MATLAB Runtime-internal application state
<library>Initialize[WithHandlers] Initialize MATLAB Runtime instance associated with library
<library>Terminate Free all resources allocated by MATLAB Runtime instance associated with library
mwArray Class used to pass input/output arguments to C functions generated by MATLAB Compiler SDK
mwException Exception type used by the mwArray API and the C++ interface functions
mwString String class used by the mwArray API to pass string data as output from certain methods
mclRunMain Mechanism for creating identical wrapper code across all platforms
mclIsMCRInitialized Determine if MATLAB Runtime has been properly initialized
mclWaitForFiguresToDie Enable deployed applications to process graphics events, enabling figure windows to remain displayed
mclGetLastErrorMessage Last error message from unsuccessful function call
mclGetLogFileName Retrieve name of log file used by MATLAB Runtime
mclIsJVMEnabled Determine if MATLAB Runtime was launched with instance of Java Virtual Machine (JVM)
mclIsNoDisplaySet Determine if -nodisplay mode is enabled

Was this topic helpful?