<library>Initialize[WithHandlers]
Initialize MATLAB Runtime instance associated with library
Synopsis
bool libraryInitialize(void) bool libraryInitializeWithHandlers( mclOutputHandlerFcn error_handler, mclOutputHandlerFcn print_handler)
Description
Each generated library has its own MATLAB® Runtime instance. These two functions,
and
library
Initialize
,
initialize the MATLAB Runtime instance associated with
library
InitializeWithHandlers
. Users must call one of
these functions after calling library
mclInitializeApplication
and before
calling any of the compiled functions exported by the library. Each returns a
boolean indicating whether or not mcli
initialization was
successful. If they return false
, calling any further compiled
functions results in unpredictable behavior.
allows users to specify how to handle error messages and printed text. The functions
passed to
library
InitializeWithHandlers
are
installed in the MATLAB Runtime instance and called whenever error text or regular text
outputs.library
InitializeWithHandlers
Examples
if (!libmatrixInitialize()) { fprintf(stderr, "An error occurred while initializing: \n %s ", mclGetLastErrorMessage()); return -2; }