No supported compiler was found.

Upon trying to compile a file using mex, I receive the following error message:
Error using mex
No supported compiler was found.
I installed Visual Studio 2017 with support for C++ and actually
mex -setup C++
lets me choose my compiler.
Which additional diagnostics could I run in order to pin down the problem?

6 comentarios

Walter Roberson
Walter Roberson el 8 de Abr. de 2019
Perhaps you need to mex -setup C
Nicolas Bourbaki
Nicolas Bourbaki el 21 de Jul. de 2019
Editada: Nicolas Bourbaki el 21 de Jul. de 2019
I finally realized that Visual Studio comes without an installed compiler.
After installing Visual Studio, it is necessary to install a compiler in addition.
Therefore, this is not really a MATLAB problem, but as mentioned below, running
mex -v -setup
proved to be very helpful in pinning down the problem.
Walter Roberson
Walter Roberson el 21 de Jul. de 2019
Visual Studio installs one compiler by default but not another one by default. Unfortunately at the moment I do not recall which is the default. It can sometimes be necessary to go back and ask visual studio to install more components.
Matt J
Matt J el 1 de Dic. de 2020
I finally realized that Visual Studio comes without an installed compiler.
And now I am facing this same problem. How does one add a compiler to Visual Studio and configure things so that Matlab can see it?
Nicolas Bourbaki
Nicolas Bourbaki el 1 de Dic. de 2020
Editada: Nicolas Bourbaki el 1 de Dic. de 2020
You would run
mex -setup C++
This lists a couple of options in case it finds a suitable compiler like the following:
mex -setup:'C:\Program Files\MATLAB\R2020b\bin\win64\mexopts\msvcpp2015.xml' C++
Walter Roberson
Walter Roberson el 1 de Dic. de 2020
By the way, Visual Studio does not install the C compiler by default.

Iniciar sesión para comentar.

 Respuesta aceptada

Matt J
Matt J el 8 de Abr. de 2019
If you just run
>> mex -setup
it should present you with the compilers that Matlab can actually see. That should provide a clue.

Más respuestas (0)

Categorías

Más información sobre Introduction to Installation and Licensing en Centro de ayuda y File Exchange.

Productos

Versión

R2018b

Etiquetas

Preguntada:

el 8 de Abr. de 2019

Comentada:

el 1 de Dic. de 2020

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by