Initialize[WithHandlers]
InitializeMATLABRuntimeinstance associated withlibrary
Synopsis
boollibraryInitialize(void) boollibraryInitializeWithHandlers( mclOutputHandlerFcn error_handler, mclOutputHandlerFcn print_handler)
Description
Each generated library has its ownMATLAB®Runtimeinstance. These two functions,
andlibrary
Initialize
, initialize theMATLAB Runtimeinstance associated withlibrary
InitializeWithHandlers
. Users must call one of these functions after callinglibrary
mclInitializeApplication
和之前调用的任何编译函数exported by the library. Each returns a boolean indicating whether or notmcli
initialization was successful. If they returnfalse
, calling any further compiled functions results in unpredictable behavior.
allows users to specify how to handle error messages and printed text. The functions passed tolibrary
InitializeWithHandlers
are installed in theMATLAB Runtimeinstance 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; }