Error using mex (no description of error)
Mostrar comentarios más antiguos
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 comentarios
Walter Roberson
el 22 de En. de 2016
Did you configure with
mex -setup
?
James Tursa
el 23 de En. de 2016
Try verbose setting to maybe get an idea of what is going on
mex -v yprime.c
Christopher Davis
el 25 de En. de 2016
Editada: Christopher Davis
el 25 de En. de 2016
Walter Roberson
el 26 de En. de 2016
What do you get if, inside MATLAB, you execute
!C:\TDM-GCC-64\\bin\gcc --version
?
Christopher Davis
el 26 de En. de 2016
Walter Roberson
el 26 de En. de 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
el 29 de En. de 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
el 29 de En. de 2016
Please do not have the same discussion in two different questions.
Christopher Davis
el 29 de En. de 2016
Editada: Christopher Davis
el 29 de En. de 2016
Christopher Davis
el 5 de Feb. de 2016
Respuestas (0)
Categorías
Más información sobre Write C Functions Callable from MATLAB (MEX Files) en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!