Error using mex (no description of error)
Show older comments
Hey all,
So I'm trying to compile an example .c program from http://www.mathworks.com/help/matlab/matlab_external/install-mingw-support-package.html and I get the following message:
>> mex yprime.c
Building with 'MinGW64 Compiler (C)'.
Error using mex
With no other description... I don't even know where to start looking.
10 Comments
Walter Roberson
on 22 Jan 2016
Did you configure with
mex -setup
?
James Tursa
on 23 Jan 2016
Try verbose setting to maybe get an idea of what is going on
mex -v yprime.c
Christopher Davis
on 25 Jan 2016
Edited: Christopher Davis
on 25 Jan 2016
Walter Roberson
on 26 Jan 2016
What do you get if, inside MATLAB, you execute
!C:\TDM-GCC-64\\bin\gcc --version
?
Christopher Davis
on 26 Jan 2016
Walter Roberson
on 26 Jan 2016
You appear to have a conflict of runtime libraries. This is the sort of thing you would use Dependency Walker to trace down.
Jeevan Joishi
on 29 Jan 2016
I understand that you are using MATLAB R2015b. It is quite unusual that the following code is returning an empty output.
!C:\TDM-GCC-64\\bin\gcc --version
It might be a possibility that the path to minGW is not present in the MATLAB path. You can verify this by typing
>> path
on the MATLAB prompt and verifying the result. An entry similar to that mentioned below should appear
C:\MATLAB\upportPackages\R2015b\mingw\mex\supportpackages\mingw
Also, an entry similar to that mentioned below should appear on the PATH environment variable on the system.
C:\TDM-GCC-64\bin
I see that there are no spaces in the path to GCC, which is the correct way of doing it. Spaces in the path to GCC if any, will cause to the call to gcc to error out.
Also, just to rule out other possibilities, are you able to compile to the program 'yprime.c' using any other compiler?
Walter Roberson
on 29 Jan 2016
Please do not have the same discussion in two different questions.
Christopher Davis
on 29 Jan 2016
Edited: Christopher Davis
on 29 Jan 2016
Christopher Davis
on 5 Feb 2016
Answers (0)
Categories
Find more on Write C Functions Callable from MATLAB (MEX Files) in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!