MEX compiler error

1. Origins of the problem

In order to run properly, some functions of Brainstorm written in C++ have to be compiled with Matlab mex compiler before being executed. This compiler requires that you have a C++ compiler compatible with Matlab installed on your computer. Some Matlab distributions or your operating system may already provide a compiler, but if it is not the case you may need to install a compiler by yourself in order to use those functionnalities of Brainstorm. For instance, on Windows, the 64-bit versions of Matlab never include any compiler, while the 32-bit usually do (lcc-win32).

2. Diagnostic

In the Matlab command window, type "mbuild -setup". After answering "y" when asked for the detection of the compilers, you should see a list of compilers available on your computer. If you do not see any other choice than "[0] None", you do not have a compatible compiler installed.
If there is an available compiler, select it, and try running again the operation that led to this error. If it does not solve the problem, please post a bug report on the Brainstorm forum.

64-bit operating systems
Before trying to install a compiler, another option is available on 64-bit systems. On a 64-bit computer, the typical installation of Matlab includes both the 32-bit and 64-bit versions of the program. The default version launched when clicking on the icon or typing "matlab" in your terminal is the 64-bit one. You should try running the 32-bit version, and type again "mbuid -setup" to check if a compiler is available on it. In that case, it would solve your problem. If not, you have no other choice than installing a compiler manually.

3. Installing a compiler

You need to pick a compiler that is compatible with your version of Matlab. For that, please refer to the Mathworks website. Select your operating system, and follow the instructions carefully.
Close Matlab. Install the compiler. Start Matlab again, type "mbuild -setup" and select the compiler that you just installed in the list. If nothing appears, please contact the Mathworks, this is not a Brainstorm issue.