Error 2 Occurred When Using VeriStand Model Generation Support Addon

Updated Nov 30, 2023

Reported In

Software

  • VeriStand
  • MATLAB
  • Simulink

Issue Details

I am using Matlab 2022b and VeriStand 2023 Q4. I installed the VeriStand Model Generation Support 1.0 and NI GCC Cross-Compiler for NI Linux Real-Time targets to compile Matlab/Simulink models but always got error 2:
gmake: *** No rule to make target `C:/Users/xiaoming.Li/AppData/Roaming/MATHWO~1/MATLAB~1/TOOLBO~1/VERIST~1/RUNTIM~1/veristand_model_capi.cpp', needed by `veristand_model_capi.obj'. Stop.
E:\517\3.Sim\4.RTTest\Test_veristand_rtw>echo The make command returned an error of 2
The make command returned an error of 2
E:\517\3.Sim\4.RTTest\Test_veristand_rtw>exit /B 1
Test  Failed  Code generation information file does not exist.  
0 of 1 models built (0 models already up to date)
Build duration: 0h 2m 1.1525s
Error: Error(s) encountered while building "Test"
I am sure that VeriStand Model Generation Support 1.0 is compatible with Matlab 2022b.

Solution

This error occurs due to spaces in the name of the model, the path to the model, or the path to the files used by the VeriStand Model Generation Support Add-on. You can refer to Gmake Error 2 When Building Simulink Model for Use in VeriStand to resolve this issue. 
If the error continues, you may resolve this error by following these steps:
  1. Uninstall the VeriStand Model Generation Support Add-on.
  2. Change the default installation location of Add-Ons.
Capture.JPG 
  1. Add a new location that doesn't contain any spaces to Matlab path.
  2. Restart the Matlab.
  3. Install the VeriStand Model Generation Support Add-on and close the Matlab.
  4. Change the installation path of Add-on from D:\MATLABAddOns\Toolboxes\VeriStand Model Generation Support\runtime_support to D:\MATLABAddOns\Toolboxes\VeriStand_Model_Generation_Support\runtime_support with no spaces.
  5. Add the new path to the list of Matlab paths.
Capture.JPG
  1. Finally, restart Matlab and try building the model.