MATLAB Answers

What's the problem with mex compiler when running simulation in accelerator mode Matlab 2015b

4 views (last 30 days)
Alexandre on 29 Jan 2016
Commented: Torsten Knodt on 6 Apr 2016
I've just upgraded Matlab from 2013a to 2015b and I have problem when compiling my model.
I have a model working perfectly on 2013a. I'm using compiler Lcc-win32 C 2.4.1 and my computer OS is windows 7 64-bits.
For Matlab 2015b, my default compiler is 'Microsoft Windows SDK 7.1 (C)' and I have Microsoft .NET Framework 4.5 installed. According to, I'm compliant.
In normal mode, I can run my simulation without problem but in Accelerator mode, I get this error :
'cmd' is not recognized as an internal or external command,
operable program or batch file.
NMAKE : fatal error U1077: 'cmd' : return code '0x1'
How can I fix that? I can send you the complete compilation log if needed.
Thank you.


Torsten Knodt
Torsten Knodt on 6 Apr 2016
I have the same on 2016A using the acceleration mode. Due to the line I see on my computer directly before the error message you give I can see that it tries to access "D:\Program" instead of "D:\Program Files". So I guess the cause is a missing escaping of spaces in the path of the compiler (I my case Visual Studio 14.0 Express). I am working on a Windows 7 64 Bit machine.

Sign in to comment.

Answers (1)

Abhisek Roy
Abhisek Roy on 4 Feb 2016
Hi Alexandre,
It looks like the issue is caused by the environment variable PATH being corrupted. Try to build the following model -
and look for the "devnull.2" file in the generated folder "xpcosc_slrt_rtw". If this the problem the file will have multiple lines stating: "'REG' is not an internal or external command, executable program or batch file."
To further confirm an issue with the PATH environment variable, open a Windows Command Prompt and type: "REG /?". Normally, it will display all the usages of the "REG" command. If different behavior is encountered, try the following:
Append the following to the PATH environment variable: C:\Windows\System32
This is the location of the "reg.exe". Adding this location to the PATH environment variable will resolve the issue.


Sign in to comment.

Translated by