User`s guide
7 Libraries
C Shared Library Target
In this section...
“C Shared Library W rapper” on page 7-4
“C Shared Library Example” on page 7-4
“Calling a Shared Library” on page 7-11
C Shared Library Wrapper
The C library wrapper option allows you to crea te a shared library from a n
arbitrary set of M-files on both Windows and UNIX. MATLAB Compiler
generates a wrapper file, a header file, and an export list. The header file
contains all of the entry points for all of the compiled M-functions. The export
list contains the set of symbols that are exported from a C share d library.
Note Even if you are not producing a shared library, you must use -W lib
or -W cpplib when including any M ATLAB Compiler generated code into
alargerapplication.
Note mclmcrrt.lib is required for successful linking. For more information,
see the MathWorks Support database and search for information on the
MSVC shared library.
C Shared Librar y Example
This example takes several M-files and creates a C shared library. It also
includes a standalone driver application to call the shared library.
Building the Shared Library
1 Copy the following files from matlabroot/e xtern/examples/compi ler to
your work directory:
matlabroo
t
/extern/examples/compiler/addmatr ix.m
7-4