mex compiler error with return value of '0'
3 views (last 30 days)
Show older comments
I have used the MATLAB MinGW installation tool to install the MinGW compiler but I encounter the following error message when I try to run the basic 'yprime.c' mex example:
mex yprime.c
Building with 'MinGW64 Compiler (C)'.
Error using mex
The command 'C:\ProgramData\MATLAB\SupportPackages\R2019a\3P.instrset\mingw_w64.instrset\bin\gcc' exited with a return value '0'
The compiler seems to be installed correctly and MATLAB clearly has the correct path to the compiler executable but the return value of '0' indicates that MATLAB is calling the compiler with no arguments. This is the mex equivalent of 'hello world' so I'm guessing that something more fundamental is wrong here and I'd appreciate any pointers about what it might be.
I'm running MATLAB 2019a on a Windows 10 machine in admistrator mode so that it can write the appropriate files.
Thanks for the help,
Bryan
2 Comments
James Tursa
on 29 Apr 2019
Edited: James Tursa
on 29 Apr 2019
First thing is to do this in verbose mode. There may be some extra info/insights into what is going on.
mex yprime.c -v
Answers (1)
Marko Järvenpää
on 31 Jul 2019
Edited: Marko Järvenpää
on 31 Jul 2019
I had a similar problem using also MATLAB 2019a on a Windows 10 machine. I was able to circumvent the problem using manual installation of MinGW using the instructions in http://khailaie.com/notes/MEX/MEX-MinGW-setup-Windows.html
The instructions are actually given for 2017b but they worked with obvious changes for my 2019a.
0 Comments
See Also
Categories
Find more on MATLAB Support for MinGW-w64 C/C++ Compiler in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!