Yes, this error occurs either because there is no C/C++ Compiler installed, or there is one installed and it has not been setup for code generation in MATLAB. Please find a list of supported compilers for MATLAB R2015b below:
Please follow the steps provided below to setup MATLAB Coder for C Code Generation:
- Install a supported C/C++ compiler, as specified in the link above. Please skip this step if you already have a supported compiler installed. For the purpose of this article, we have provided a link to the Windows SDK 7.1 with .NET framework 4.0 compiler, which is supported for MATLAB R2015b. Please find the link to the installation file below:
NOTE - In case there any issues during the installation process, specifically if you observe an 'Installation Failed' error message, please refer to the following link:
<http://www.mathworks.com/matlabcentral/answers/95039-why-does-the-sdk-7-1-installation-fail-with-an-installation-failed-message-on-my-windows-system>
* Please run the following command at the MATLAB Command Window:
>> mex -setup
_ This command will locate all the C/C++ Compiler installed on the machine and allow you to set one as the default compiler for code generation. For more information on this command, please refer to the link:
<http://www.mathworks.com/help/matlab/ref/mex.html?searchHighlight=mex%20-setup>_
- MATLAB has now been setup for code generation.
With regards to the 2nd question, MATLAB Coder can be used to generate code for multiple entry-point functions. When adding an entry-point function in the MATLAB Coder app, there is an option to add more entry-point functions.