Using the C++ Math Library    

Linking Applications Without mbuild 

To build the examples or your own applications without mbuild, compile the file with a robust C++ compiler. The compiler you use must support both templates and exceptions. Set the include file search path to contain the directory that contains the file matlab.hpp; compilers typically use the -I switch to add directories to the include file search path. See Appendix A to determine where matlab.hpp is installed. Link the resulting object files against the libraries in this order:

  1. MATLAB C++ Math Library (libmatpp on UNIX; libmatp* on Windows, where * is replaced by the suffix for your compiler)
  2. MATLAB M-File Math Library (libmmfile)
  3. MATLAB Built-In Library (libmatlb)
  4. MATLAB MAT-file Library (libmat)
  5. MATLAB Array Access and Creation Library (libmx)
  6. Standard C Math Library (libm)

Specifying the libraries in the wrong order on the command line typically causes linker errors.

On some platforms, additional libraries are necessary; see the platform-specific section of the mbuild script for the names and order of these libraries on the platforms we support.

On PCs, import libraries can be found in <matlab>\extern\lib\win32\<compiler>.


 Troubleshooting mbuild Distributing Stand-Alone Applications