Mex won't recognize Microsoft Visual C++ Compilers

조회 수: 167 (최근 30일)
Ian Connelly
Ian Connelly 2016년 3월 4일
답변: Youssef Elshebani 2022년 6월 23일
Hey all, I'm trying to configure my Labjack to work with my MATLAB for a project and I can't see to get the two to sync up. I've downloaded the Labjack drivers from the Labjack site, ensured that I have Microsoft Visual C++ 2015 installed which is in the list of supported compilers for MATLAB, but whenever I run the mex -setup command, I get the error: "No supported compiler or SDK was found. For options, visit http://www.mathworks.com/support/compilers/R2015a/win64.html."
I've looked at other questions for this, and none of the answers have helped me. The problem seems to be that I can't get mex to recognize my compilers which are clearly installed on my computer. Any help would be amazing, I can't seem to figure this out.
  댓글 수: 2
Joachim Schlosser
Joachim Schlosser 2016년 3월 4일
What is the output of
mex -setup -v
Ian Connelly
Ian Connelly 2016년 3월 4일
Verbose mode is on.
... Looking for compiler 'Intel C++ Composer XE 2011 with Microsoft SDK 7.1 (C)' ...
... Looking for environment variable 'ICPP_COMPILER12' ...No.
Did not find installed compiler 'Intel C++ Composer XE 2011 with Microsoft SDK 7.1 (C)'.
... Looking for compiler 'Intel C++ Composer XE 2011 with Microsoft Visual Studio 2008 (C)' ...
... Looking for environment variable 'ICPP_COMPILER12' ...No.
Did not find installed compiler 'Intel C++ Composer XE 2011 with Microsoft Visual Studio 2008 (C)'.
... Looking for compiler 'Intel C++ Composer XE 2011 with Microsoft Visual Studio 2010 (C)' ...
... Looking for environment variable 'ICPP_COMPILER12' ...No.
Did not find installed compiler 'Intel C++ Composer XE 2011 with Microsoft Visual Studio 2010 (C)'.
... Looking for compiler 'Intel C++ Composer XE 2013 with Microsoft SDK 7.1' ...
... Looking for environment variable 'ICPP_COMPILER14' ...No.
... Looking for environment variable 'ICPP_COMPILER13' ...No.
Did not find installed compiler 'Intel C++ Composer XE 2013 with Microsoft SDK 7.1'.
... Looking for compiler 'Intel C++ Composer XE 2013 with Microsoft Visual Studio 2010 (C)' ...
... Looking for environment variable 'ICPP_COMPILER14' ...No.
... Looking for environment variable 'ICPP_COMPILER13' ...No.
Did not find installed compiler 'Intel C++ Composer XE 2013 with Microsoft Visual Studio 2010 (C)'.
... Looking for compiler 'Intel C++ Composer XE 2013 with Microsoft Visual Studio 2012 (C)' ...
... Looking for environment variable 'ICPP_COMPILER14' ...No.
... Looking for environment variable 'ICPP_COMPILER13' ...No.
Did not find installed compiler 'Intel C++ Composer XE 2013 with Microsoft Visual Studio 2012 (C)'.
... Looking for compiler 'Microsoft Visual C++ 2008 (C)' ...
... Looking for environment variable 'VS90COMNTOOLS' ...No.
Did not find installed compiler 'Microsoft Visual C++ 2008 (C)'.
... Looking for compiler 'Microsoft Visual C++ 2010 (C)' ...
... Looking for environment variable 'VS100COMNTOOLS' ...No.
Did not find installed compiler 'Microsoft Visual C++ 2010 (C)'.
... Looking for compiler 'Microsoft Visual C++ 2012 (C)' ...
... Looking for registry setting 'HKLM\SOFTWARE\Microsoft\VisualStudio\SxS\VS7' 11.0 ...No.
... Looking for registry setting 'HKCU\SOFTWARE\Microsoft\VisualStudio\SxS\VS7' 11.0 ...No.
... Looking for registry setting 'HKLM\SOFTWARE\Wow6432Node\Microsoft\VisualStudio\SxS\VS7' 11.0 ...No.
... Looking for registry setting 'HKCU\SOFTWARE\Wow6432Node\Microsoft\VisualStudio\SxS\VS7' 11.0 ...No.
Did not find installed compiler 'Microsoft Visual C++ 2012 (C)'.
... Looking for compiler 'Microsoft Visual C++ 2013 Professional (C)' ...
... Looking for registry setting 'HKLM\SOFTWARE\Microsoft\VisualStudio\SxS\VS7' 12.0 ...No.
... Looking for registry setting 'HKCU\SOFTWARE\Microsoft\VisualStudio\SxS\VS7' 12.0 ...No.
... Looking for registry setting 'HKLM\SOFTWARE\Wow6432Node\Microsoft\VisualStudio\SxS\VS7' 12.0 ...No.
... Looking for registry setting 'HKCU\SOFTWARE\Wow6432Node\Microsoft\VisualStudio\SxS\VS7' 12.0 ...No.
Did not find installed compiler 'Microsoft Visual C++ 2013 Professional (C)'.
... Looking for compiler 'Microsoft Windows SDK 7.1 (C)' ...
... Looking for registry setting 'HKLM\SOFTWARE\Microsoft\Microsoft SDKs\Windows\v7.1' InstallationFolder ...No.
Did not find installed compiler 'Microsoft Windows SDK 7.1 (C)'.

댓글을 달려면 로그인하십시오.

답변 (7개)

Matthew Edwards
Matthew Edwards 2017년 5월 2일
I ran into this same issue; Visual Studio 2015 does not install C++ by default. "You have to rerun the setup, select Modify and then check Programming Language -> C++"

Dror Lederman
Dror Lederman 2016년 3월 27일
Hi, Having the same issue with Matlab 2015b and studio prof. 2015, on Win 8.1
mex -setup -v
Verbose mode is on.
... Looking for compiler 'Intel C++ Composer XE 2011 with Microsoft SDK 7.1 (C)' ...
... Looking for environment variable 'ICPP_COMPILER12' ...No.
Did not find installed compiler 'Intel C++ Composer XE 2011 with Microsoft SDK 7.1 (C)'.
... Looking for compiler 'Intel C++ Composer XE 2011 with Microsoft Visual Studio 2008 (C)' ...
... Looking for environment variable 'ICPP_COMPILER12' ...No.
Did not find installed compiler 'Intel C++ Composer XE 2011 with Microsoft Visual Studio 2008 (C)'.
... Looking for compiler 'Intel C++ Composer XE 2011 with Microsoft Visual Studio 2010 (C)' ...
... Looking for environment variable 'ICPP_COMPILER12' ...No.
Did not find installed compiler 'Intel C++ Composer XE 2011 with Microsoft Visual Studio 2010 (C)'.
... Looking for compiler 'Intel C++ Composer XE 2013 with Microsoft SDK 7.1' ...
... Looking for environment variable 'ICPP_COMPILER14' ...No.
... Looking for environment variable 'ICPP_COMPILER13' ...No.
Did not find installed compiler 'Intel C++ Composer XE 2013 with Microsoft SDK 7.1'.
... Looking for compiler 'Intel C++ Composer XE 2013 with Microsoft Visual Studio 2010 (C)' ...
... Looking for environment variable 'ICPP_COMPILER14' ...No.
... Looking for environment variable 'ICPP_COMPILER13' ...No.
Did not find installed compiler 'Intel C++ Composer XE 2013 with Microsoft Visual Studio 2010 (C)'.
... Looking for compiler 'Intel C++ Composer XE 2013 with Microsoft Visual Studio 2012 (C)' ...
... Looking for environment variable 'ICPP_COMPILER14' ...No.
... Looking for environment variable 'ICPP_COMPILER13' ...No.
Did not find installed compiler 'Intel C++ Composer XE 2013 with Microsoft Visual Studio 2012 (C)'.
... Looking for compiler 'MinGW64 Compiler (C)' ...
... Looking for environment variable 'MW_MINGW64_LOC' ...No.
Did not find installed compiler 'MinGW64 Compiler (C)'.
... Looking for compiler 'Microsoft Visual C++ 2008 (C)' ...
... Looking for environment variable 'VS90COMNTOOLS' ...No.
Did not find installed compiler 'Microsoft Visual C++ 2008 (C)'.
... Looking for compiler 'Microsoft Visual C++ 2010 (C)' ...
... Looking for environment variable 'VS100COMNTOOLS' ...No.
Did not find installed compiler 'Microsoft Visual C++ 2010 (C)'.
... Looking for compiler 'Microsoft Visual C++ 2012 (C)' ...
... Looking for registry setting 'HKLM\SOFTWARE\Microsoft\VisualStudio\SxS\VS7' 11.0 ...No.
... Looking for registry setting 'HKCU\SOFTWARE\Microsoft\VisualStudio\SxS\VS7' 11.0 ...No.
... Looking for registry setting 'HKLM\SOFTWARE\Wow6432Node\Microsoft\VisualStudio\SxS\VS7' 11.0 ...No.
... Looking for registry setting 'HKCU\SOFTWARE\Wow6432Node\Microsoft\VisualStudio\SxS\VS7' 11.0 ...No.
Did not find installed compiler 'Microsoft Visual C++ 2012 (C)'.
... Looking for compiler 'Microsoft Visual C++ 2013 Professional (C)' ...
... Looking for registry setting 'HKLM\SOFTWARE\Microsoft\VisualStudio\SxS\VS7' 12.0 ...No.
... Looking for registry setting 'HKCU\SOFTWARE\Microsoft\VisualStudio\SxS\VS7' 12.0 ...No.
... Looking for registry setting 'HKLM\SOFTWARE\Wow6432Node\Microsoft\VisualStudio\SxS\VS7' 12.0 ...No.
... Looking for registry setting 'HKCU\SOFTWARE\Wow6432Node\Microsoft\VisualStudio\SxS\VS7' 12.0 ...No.
Did not find installed compiler 'Microsoft Visual C++ 2013 Professional (C)'.
... Looking for compiler 'Microsoft Visual C++ 2015 Professional (C)' ...
... Looking for registry setting 'HKLM\SOFTWARE\Microsoft\VisualStudio\SxS\VS7' 14.0 ...No.
... Looking for registry setting 'HKCU\SOFTWARE\Microsoft\VisualStudio\SxS\VS7' 14.0 ...No.
... Looking for registry setting 'HKLM\SOFTWARE\Wow6432Node\Microsoft\VisualStudio\SxS\VS7' 14.0 ...Yes ('C:\Program Files (x86)\Microsoft Visual Studio 14.0\').
... Looking for file 'C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\bin\amd64\cl.exe' ...No.
Did not find installed compiler 'Microsoft Visual C++ 2015 Professional (C)'.
... Looking for compiler 'Microsoft Windows SDK 7.1 (C)' ...
... Looking for registry setting 'HKLM\SOFTWARE\Microsoft\Microsoft SDKs\Windows\v7.1' InstallationFolder ...No.
... Looking for registry setting 'HKLM\SOFTWARE\Wow6432Node\Microsoft\Microsoft SDKs\Windows\v7.1' InstallationFolder ...No.
Did not find installed compiler 'Microsoft Windows SDK 7.1 (C)'.
Error using mex
No supported compiler or SDK was found. You can install the freely available MinGW-w64 C/C++ compiler; see Install MinGW-w64
Compiler. For more options, see http://www.mathworks.com/support/compilers/R2015b/win64.html.

Steven Hoffman
Steven Hoffman 2017년 9월 13일
If anyone has trouble with Matlab 2016b or 2017a recognizing the Visual Studio 2017 compiler, this seems to be a bug. MathWorks has provided a work around though that you can download. See this bug report: MathWorks Bug Report
  댓글 수: 2
Walter Roberson
Walter Roberson 2017년 9월 24일
Not technically a "bug" as such: VS 2017 was released in 2017, after R2016b had been in existence nearly 6 months. VS 2017 was released on March 6, 2017, just three days before MATLAB R2017a, which was far too late for MATLAB R2017a to have support for it built in. The items linked to are patches for R2016b and R2017a to support VS 2017 essentially retroactively.
Peter Cook
Peter Cook 2019년 6월 20일
Is there a similar patch in place for Visual Studio 2019, or should I edit the mex_C_win64.xml & mex_C++_win64.xml files manually?

댓글을 달려면 로그인하십시오.


Youssef Elshebani
Youssef Elshebani 2022년 6월 23일
I still have the same issue in 2021b release of matlab not recognizing the compiler even though its installed

Walter Roberson
Walter Roberson 2016년 3월 4일
Which operating system are you using? If you are using Windows 10, then MATLAB R2015a is not supported on Windows 10, and in particular you would have a difficult time getting a working compiler for it.
  댓글 수: 2
Lee Brady
Lee Brady 2016년 3월 4일
편집: Lee Brady 2016년 3월 4일
I am working on the same project as the original poster, and I have R2015b and am running into the same issues.
Walter Roberson
Walter Roberson 2016년 3월 4일
편집: Walter Roberson 2016년 3월 4일
And neither of you have indicated which operating system you are using.
Is your Visual C++ 2015 the Professional version or the Express version? Only the Professional version is supported.

댓글을 달려면 로그인하십시오.


xingyu zhang
xingyu zhang 2016년 12월 10일
I met the same problem, how can I solve it

Mauro Graça
Mauro Graça 2019년 6월 12일
cl.exe is not found. Just Install C++ tools from visual studio installer

카테고리

Help CenterFile Exchange에서 Troubleshooting in MATLAB Compiler SDK에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by