This issue can occur if your machine does not have appropriate permissions to edit the registry. The Microsoft Visual Studio compilers are configured in such a way that they require the ability to query the system registry using "reg.exe". The compiler uses configuration batch files "vcvarsall.bat", "vcvars64.bat", and "VCVarsQueryRegistry.bat" that call the "reg query" command to query the registry for the paths of different components.
To verify that this is the cause, you can try the following:
- Open a Windows Command Prompt window (press Windows Key + R, type in "cmd" in the field that appears, and press "Enter")
- Enter the following commands, one-by-one, to query the registry:
reg query "HKLM\SOFTWARE\Microsoft\VisualStudio\SxS\VS7" /v "10.0"
reg query "HKCU\SOFTWARE\Microsoft\VisualStudio\SxS\VS7" /v "10.0"
reg query "HKLM\SOFTWARE\Wow6432Node\Microsoft\VisualStudio\SxS\VS7" /v "10.0"
reg query "HKCU\SOFTWARE\Wow6432Node\Microsoft\VisualStudio\SxS\VS7" /v "10.0"
If the output of each command shows:
"ERROR: Registry editing has been disabled by your administrator."
then this confirms that this is a permissions issue and you can perform either of the following actions:
- You can switch to using either the Microsoft SDK or MinGW compilers, as they will not impose the same requirements on permissions. Please see the links below for more information on each of these:* https://www.mathworks.com/help/matlab/matlab_external/install-mingw-support-package.html* https://www.mathworks.com/matlabcentral/answers/101105-how-do-i-install-microsoft-windows-sdk-7-1* Note: Simulink Real-Time does not support these two compilers.
- You can work with your IT administrators to change the permissions and/or "Group Policy" to allow the "reg query" commands on your machine. Obtaining sufficient permission should then allow the batch files mentioned above to execute successfully.
If the output does not show the error message, then please take a screenshot of the entire Windows Command Prompt window and of the entire build log of Simulink, and contact MathWorks Technical Support.