Real time simulink build error

10 views (last 30 days)
Rajashree Ravi
Rajashree Ravi on 11 Oct 2017
Commented: Peter Bouten on 23 Sep 2020
I am trying to build the example ex_slrt_rt_osc for real time Simulink and am getting the following error '"C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\Tools\VCVarsQueryRegistry.bat"' is not recognized as an internal or external command,operable program or batch file. I have the already installed the Visual C compiler required for this and cannot resolve this error on my own. Any immediate help is much appreciated.

Answers (1)

Prashant Arora
Prashant Arora on 16 Oct 2017
Hi Rajashree,
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:
(1) Open a Windows Command Prompt window (press Windows Key + R, type in "cmd" in the field that appears, and press "Enter")
(2) Enter the following commands, one-by-one, to query the registry:
reg query "HKLM\SOFTWARE\Microsoft\VisualStudio\SxS\VS7" /v "14.0"
reg query "HKCU\SOFTWARE\Microsoft\VisualStudio\SxS\VS7" /v "14.0"
reg query "HKLM\SOFTWARE\Wow6432Node\Microsoft\VisualStudio\SxS\VS7" /v "14.0"
reg query "HKCU\SOFTWARE\Wow6432Node\Microsoft\VisualStudio\SxS\VS7" /v "14.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. 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 to execute successfully.
  1 Comment
Peter Bouten
Peter Bouten on 23 Sep 2020
This item appears to be still valid for Simulink Real Time 2019b with Visual Studio 14.27 running without admin rights.
I get the error:
### Linking ... link /NOLOGO /DLL /SUBSYSTEM:CONSOLE /DEF:xpcvcdll.def /Include:_malloc /MAP /DEBUG /IGNORE:4099 C:\PROGRA~1\MATLAB\R2019b\toolbox\rtw\targets\xpc\target\build\lib\libatlas.a C:\PROGRA~1\MATLAB\R2019b\toolbox\rtw\targets\xpc\target\build\lib\libcblas.a xpcruntime.lib C:\ProgramData\Speedgoat\speedgoatlib\R2019b\9.1.0\sg_blocks\common\libsg\libsg_MSVC160_vc.lib D:\AppData\boutenp1\workspace\SpeedGoat_Repo\IHECU_GEN2_WorkSpace\codegen\slprj\slrt\_sharedutils\instrumented\rtwshared.lib xpctarget.obj appmappingData.obj legacy_stdio.obj @SpeedGoat_HostModel.rsp @SpeedGoat_HostModel_ref.rsp -out:SpeedGoat_HostModel_slrt.dll libucrt.lib(exit.obj) : fatal error LNK1112: module machine type 'x64' conflicts with target machine type 'x86' NMAKE : fatal error U1077: '"C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.27.29110\bin\HostX86\x86\link.EXE"' : return code '0x458' Stop. The make command returned an error of 2
The build process appears to use the VCVARSALL.BAT x86, which looks like it ran succesfull:
When I start Matlab with admin rights the build is succesfull.

Sign in to comment.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!