MATLAB COMPILER RELEASE NOTES User's Guide Page 143

  • Download
  • Add to my manuals
  • Print
  • Page
    / 264
  • Table of contents
  • TROUBLESHOOTING
  • BOOKMARKS
  • Rated. / 5. Based on customer reviews
Page view 142
Supported Executable Types
5-27
This example uses several functions from the toolbox\matlab\timefun
directory (weekday, date, tic, calendar, toc) to create a C++ library called
libtimefun.The-W lib:libtimefun -L Cpp options produce the C++ library
files shown in this table.
Note On some platforms, including Microsoft Windows NT, support for C++
shared libraries is limited and the C++ mangled function names must be
exported. Refer to your vendor-supplied documentation for details on creating
C++ shared libraries.
libtimefun.cpp
The C++ wrapper file (libtimefun.cpp) initializes the state of
Compiler-ge nerated f unct io ns so that those functions ca n be called from C++
code not generated by the Compiler. These files are produced from t he
command
mcc -W lib:libtimefun -L Cpp weekday date tic calendar toc
Porting Generated Code to a Different Platform
The code generated by the MATLAB Compiler is portable among platforms.
However,ifyoubuildanexecutable from
foo.m ona PCrunningWindows,that
same file will not run on a UNIX system.
For example, you cannot simply copy
foo.mex (where the mex extension varies
by platform) from a PC to a Sun system and expect the code to work, because
binary formats are different on different platforms (all supported executable
typesarebinary). However,youcouldcopyeither all of the generatedCcode or
foo.m fromthePCtotheSunsystem.Then,ontheSunplatformyoucoulduse
mex or mcc to produce a foo.mex thatwouldworkontheSunsystem.
File Description
libtimefun.cpp
C++ w rapper file
libtimefun.hpp
C++ header file
Page view 142
1 2 ... 138 139 140 141 142 143 144 145 146 147 148 ... 263 264

Comments to this Manuals

No comments