MATLAB: Dear Sir, I am trying to convert .m file to VHDL from HDL coder. But I m getting following errors. Please solve the problem.

Initially I have taken simple code which I m trying to convert into VHDL. But following errors are coming:
In target build log:
18 Creating library test_hdl_mex.lib and object test_hdl_mex.exp
19 'cmd' is not recognized as an internal or external command,
20 operable program or batch file.
21 gmake: *** [test_hdl_mex.mexw64] Error 1
In work flow advisor:
### Begin TestBench generation.
??? Build error: Compilation returned error status code 2. See the Target Build Log in the report for further details.
Error in ==> test Line: 1 Column: 1
Code generation failed: View Error Report
Error using coder.internal.Float2FixedConverter/runTestBenchToLogDataNew/runSimulation (line 632)
The compiled entry-point 'test_hdl_mex' cannot be located.
Error in Float2FixedConverter>runTestBenchToLogDataNew/withScopeProtection/runSimWithTBEvalSimFcn at 567
Error in Float2FixedConverter>runTestBenchToLogDataNew at 495
Error in HDLCoderTB>computeData at 399
Error in HDLCoderTB>generateTB at 460
Error in Manager>wfa_runSimulation at 760
By mex -setup I have also chosen Visual Stdio as compilier
I have tried on both 32 vs 64bit Matlab.
My Laptop is 64 bit.
Please solve my problem, I am stuck.
Sandeep Rastogi
Persuing M. Tech IIT Bombay, India

Best Answer

You may have to add C:\Windows\System32 to your Path variable in environment variables.
Before you try to create the library, try
setenv('PATH', [getenv('PATH'); ';C:\Windows\System32'])
and then try creating the library.
If you are using Windows 10 then location might be different.
Related Question