Using the C++ Math Library | ![]() ![]() |
Building an Application
C++ source code for example ex1.cpp
is included in the <matlab>
\extern\examples\cppmath
directory; <matlab>
represents the top-level directory where MATLAB is installed on your system. To verify that mbuild
is properly configured on your system to create stand-alone applications, enter at the DOS prompt:
mbuild ex1.cpp
This should create the file called ex1.exe
. Stand-alone applications created on Windows 95 or Windows NT always have the extension .exe
. The created application is a 32-bit Microsoft Windows console application. If you have a problem using mbuild, see Troubleshooting mbuild.
Shared Libraries (DLLs)
All the WIN32 Dynamic Link Libraries (DLLs) for the MATLAB C++ Math Library are in the directory
<
matlab
>
\bin
The .def
files for the Microsoft and Borland compilers are in the <matlab>\extern\include
directory. Import libraries for supported compilers can be found in <matlab>\extern\lib\win32\<compiler>
.
Before running a stand-alone application, you must ensure that the directory containing the DLLs is on your path. The directory must be on your operating system $PATH
environment variable. On Windows 95, set the value in your autoexec.bat
file; on Windows NT, use the Control Panel to set it.
Running Your Application
You can now run your stand-alone application by launching it from the command line. For example,
ex1 [ 1 3 5 ; 2 4 6 ] [ 1 4 ; 2 5 ; 3 6 ] Please enter a matrix:
![]() | Configuring the Build Environment | mbuild Options | ![]() |