| Contents | Index |
This section identifies some of the more common problems that might occur when configuring mbuild to create standalone applications.
Options File Not Writable. When you run mbuild -setup, mbuild makes a copy of the appropriate options file and writes some information to it. If the options file is not writable, you are asked if you want to overwrite the existing options file. If you choose to do so, the existing options file is copied to a new location and a new options file is created.
Directory or File Not Writeable. If a destination folder or file is not writable, ensure that the permissions are properly set. In certain cases, make sure that the file is not in use.
mbuild Generates Errors. If you run mbuild filename and get errors, it may be because you are not using the proper options file. Run mbuild -setup to ensure proper compiler and linker settings.
Compiler and/or Linker Not Found. On Windows, if you get errors such as unrecognized command or file not found, make sure the command-line tools are installed and the path and other environment variables are set correctly in the options file. For Microsoft® Visual Studio®, for example, make sure to run vcvars32.bat (MSVC 6.x and earlier) or vsvars32.bat (MSVC 8.x and later).
mbuild Not a Recognized Command. If mbuild is not recognized, verify that matlabroot\bin is in your path. On UNIX, it may be necessary to rehash.
mbuild Works from the Shell But Not from MATLAB (UNIX). If the command
mcc -m helloworks from the UNIX command prompt but not from the MATLAB prompt, you may have a problem with your .cshrc file. When MATLAB launches a new C shell to perform compilations, it executes the .cshrc script. If this script causes unexpected changes to the PATH environment variable, an error may occur. You can test this before starting MATLAB by performing the following:
setenv SHELL /bin/shIf this works correctly, then you should check your .cshrc file for problems setting the PATH environment variable.
Cannot Locate Your Compiler (Windows). If mbuild has difficulty locating your installed compilers, it is useful to know how it finds compilers. mbuild automatically detects your installed compilers by first searching for locations specified in the following environment variables:
MSVCDIR for Microsoft Visual C++, Version 6.0 or 8.0
Next, mbuild searches the Windows registry for compiler entries.
Internal Error when Using mbuild -setup (Windows). Some antivirus software packages may conflict with the mbuild -setup process. If you get an error message during mbuild -setup of the following form
mex.bat: internal error in sub get_compiler_info(): don't recognize <string>then you need to disable your antivirus software temporarily and rerun mbuild -setup. After you have successfully run the setup option, you can re-enable your antivirus software.
Verification of mbuild Fails. If none of the previous solutions addresses your difficulty with mbuild, contact Technical Support at MathWorks at http://www.mathworks.com/contact_TS.html.
![]() | Failure Points and Possible Solutions | MATLAB Compiler | ![]() |

Learn how to build standalone executables and C/C++ shared libraries from MATLAB code.
| © 1984-2012- The MathWorks, Inc. - Site Help - Patents - Trademarks - Privacy Policy - Preventing Piracy - RSS |