User`s guide

Supported Executable Types
5-25
This example uses several functions from the toolbox\matlab\timefun
directory (
weekday, date, tic, calendar, toc) to create a library wrapper. The
-W lib:libtimefun -L C options produce the files shown in this table.
libtimefun.c
The C wrapper file (libtimefun.c) contains the initialization
(
libtimefunInitialize) and termination (libtimefunTerminate) functions
for the library. You must call
libtimefunInitialize before you call any
Compiler-generated code. This function initializes the state of
Compiler-generated functions so that those functions can be called from C code
not generated by the Compiler. You must also call
libtimefunTerminate before
you unload the library.
The library files in this example are produced from the command
mcc -W lib:libtimefun -L C weekday date tic calendar toc
C Shared Library
The MATLAB Compiler allows you to build a shared library from the files
created in the previous section, C Libraries. To build the shared library,
libtimefun.ext, in one step, use
mcc -B csharedlib:libtimefun weekday data tic calendar toc
This example uses the csharedlib bundle file
-t -W lib:filename -T link:lib -h libmmfile.mlib
The bundle file option, -B <filename>:[<a1>,<a2>,...,<an>], replaces the
entire expression on the
mcc command line with the contents of the specified
file and it allows you to use replacement parameters. This example uses the
csharedlib bundle file and replaces the expression
File Description
libtimefun.c
C wrapper file
libtimefun.h
C header file
libtimefun.exports
C export list
libtimefun.mlib
M-file library