MATLAB Compiler    

Generated Code

This chapter investigates the generated header files, interface functions, and wrapper functions for the C MEX, stand-alone C and C++ targets, and C and C++ libraries.

When you use the MATLAB Compiler to compile an M-file, it generates these files:

The C or C++ code that is generated by the Compiler and the header file are independent of the final target type and target platform. That is, the C or C++ code and header file are identical no matter what the desired final output. The wrapper file provides the code necessary to support the output executable type. So, the wrapper file is different for each executable type.

This table shows the names of the files generated when you compile a generic M-file (file.m) for the MEX and stand-alone targets. The table also shows the files generated when you compile a set of files (filelist) for the library target.

Table 5-1: Compiler-Generated Files  

C
C++
Header
file.h
file.hpp
Code
file.c
file.cpp
Main Wrapper
(-W main)

file_main.c
file_main.cpp
MEX Wrapper
(-W mex)

file_mex.c
N/A (C++ MEX-files are not supported.)
Simulink Wrapper
(-W simulink)

file_simulink.c
N/A (C++ MEX-files are not supported.)
Library
(-W lib:filelist)

filelist.c
filelist.h
filelist.exports
filelist.mlib

filelist.cpp
filelist.hpp
filelist.mlib


 Code Generation Overview Compiling Private and Method Functions