Get compiler configuration information for building MEX-files


  • cc = mex.getCompilerConfigurations example
  • cc = mex.getCompilerConfigurations(lang)
  • cc = mex.getCompilerConfigurations(lang,list) example



cc = mex.getCompilerConfigurations returns an object cc containing information about the default compiler configurations used by the mex command. There is one configuration for each supported language.

cc = mex.getCompilerConfigurations(lang) returns an array of objects for the given language, lang.


cc = mex.getCompilerConfigurations(lang,list) returns information about the set of configurations, list.


expand all

Display Information for C Compiler

myCCompiler = mex.getCompilerConfigurations('C','Selected')
myCCompiler = 

  CompilerConfiguration with properties:

             Name: 'Microsoft Visual C++ 2010 (C)'
     Manufacturer: 'Microsoft'
         Language: 'C'
          Version: '10.0'
         Location: 'c:\Program Files (x86)\Microsoft Visual Studio 10.0'
        ShortName: 'MSVC100'
         Priority: 'A'
          Details: [1x1 mex.CompilerConfigurationDetails]
       LinkerName: 'link'
    LinkerVersion: ''
           MexOpt: 'C:\Users\auser\AppData\Roaming\MathWorks\MATLAB\R2014a\mex_C_win64.xml'

MATLAB® displays information depending on your architecture and your version of MATLAB.

Display Number of Supported C Compilers

cLanguageCC = mex.getCompilerConfigurations('C','Supported');
ans =

The number of compilers for your version of MATLAB might be different.

Input Arguments

expand all

lang — Language'Any' (default) | 'C' | 'C++' | 'CPP' | 'Fortran'

Language, specified as one of these values.


All supported languages. This is the default value.


All C compiler configurations, including C++ configurations.

'C++' or 'CPP'

All C++ compiler configurations.


All Fortran compiler configurations.

list — Set of configurations'Selected' (default) | 'Installed' | 'Supported'

Set of configurations, specified as one of these values.


The default compiler for each language.


All supported compilers mex finds installed on your system.


All compilers supported in the current release.

Output Arguments

expand all

cc — Compiler informationmex.CompilerConfiguration object or array of objects

Compiler information, specified as a mex.CompilerConfiguration object or array of mex.CompilerConfiguration objects. The mex.CompilerConfiguration class contains the following read-only properties.

NameCompiler name.

Character string used to identify options file for the compiler.

ManufacturerName of the manufacturer of the compiler.
LanguageCompiler language.

(Windows® platforms only) Version of the compiler.


(Windows platforms only) Folder where compiler is installed.


More read-only properties about the compiler configuration. These properties might differ across compilers, platforms, and releases of MATLAB.

LinkerNameLinker name.

(Windows platforms only) Version of the linker.


Name and full path to options file.


The priority of this compiler.

See Also

Was this topic helpful?