Changing Default Compiler

If you have multiple MATLAB®-supported compilers for a language installed on your system, MATLAB selects one as the default compiler. You can change the default using the mex -setup language command. If you have multiple compilers, MATLAB displays a message with links to set up a different compiler.

If you call mex -setup without the language argument, MATLAB displays links to the other supported languages. Select a link to change the default for building MEX-files in that language. MATLAB maintains separate default compiler options for C language and C++ language files.

If you call mex -setup from an operating system prompt, MATLAB displays the same information. However, the messages do not contain links. Instead, MATLAB displays the appropriate mex command syntax for changing the default compiler. Copy the command and paste it into the operating system prompt.

The compiler you choose remains the default until you call mex -setup to select a different default.

C Compilers

To change the default C compiler, at the MATLAB command prompt, type:

mex -setup

mex -setup defaults to information about the C compiler. Alternatively, type:

mex -setup c

C++ Compilers

To change the default C++ compiler, type:

mex -setup cpp

See Also

Related Examples

External Web Sites

Was this topic helpful?