Set Visual C++ 2010 as default compiler for MATLAB 2014a

3 views (last 30 days)
Hi. I'm working on a project that uses NI Veristand (an addin to MATLAB from National Instruments). To be able to use it for code generation, the mex compiler has to be Visual C++ 2010. I have Visual Studio 2013 installed and hence Visual C++ 2013 Professional is chosen.
Although I installed Visual C++ 2010 SP1 on my machine (Windows 8.1 x64), it is not recognized as alternative compiler. Only 2013 version is found. I have included the verbose of the mex so someone might assist me.
>> 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 '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 ...Yes ('C:\Program Files (x86)\Microsoft Visual Studio 11.0\'). ... Looking for file 'C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\bin\amd64\cl.exe' ...No. Did not find installed compiler 'Microsoft Visual C++ 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' ...Yes ('C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\Tools\'). ... Looking for file 'C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\bin\amd64\cl.exe' ...No. Did not find installed compiler 'Microsoft Visual C++ 2010 (C)'. ... Looking for compiler 'Microsoft Visual C++ 2013 Professional (C)' ... ... Looking for registry setting 'HKLM\SOFTWARE\Microsoft\VisualStudio\SxS\VS7' 12.0 ...Yes ('C:\Program Files (x86)\Microsoft Visual Studio 12.0\'). ... Looking for file 'C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\bin\amd64\cl.exe' ...Yes. ... Looking for folder 'C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC' ...Yes. ... Looking for registry setting 'HKLM\SOFTWARE\Microsoft\Microsoft SDKs\Windows\v8.1' InstallationFolder ...No. ... Looking for registry setting 'HKCU\SOFTWARE\Microsoft\Microsoft SDKs\Windows\v8.1' InstallationFolder ...No. ... Looking for registry setting 'HKLM\SOFTWARE\Wow6432Node\Microsoft\Microsoft SDKs\Windows\v8.1' InstallationFolder ...Yes ('C:\Program Files (x86)\Windows Kits\8.1\'). ... Looking for registry setting 'HKLM\SOFTWARE\Microsoft\VisualStudio\SxS\VS7' 12.0 ...Yes ('C:\Program Files (x86)\Microsoft Visual Studio 12.0\'). ... Looking for registry setting 'HKLM\SOFTWARE\Microsoft\VisualStudio\SxS\VC7' 12.0 ...No. ... Looking for registry setting 'HKCU\SOFTWARE\Microsoft\VisualStudio\SxS\VC7' 12.0 ...No. ... Looking for registry setting 'HKLM\SOFTWARE\Wow6432Node\Microsoft\VisualStudio\SxS\VC7' 12.0 ...Yes ('C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\'). ... Looking for environment variable 'VS120COMNTOOLS' ...Yes ('C:\Program Files (x86)\Microsoft Visual Studio 12.0\Common7\Tools\'). ... Looking for file 'C:\Program Files (x86)\Microsoft Visual Studio 12.0\Common7\IDE\devenv.exe' ...Yes. ... Looking for registry setting 'HKLM\SOFTWARE\Microsoft\VisualStudio\SxS\VS7' 12.0 ...Yes ('C:\Program Files (x86)\Microsoft Visual Studio 12.0\'). ... Looking for file 'C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\vcvarsall.bat' ...Yes. ... Looking for folder 'C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC' ...Yes. Found 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)'. ... Looking for compiler 'Microsoft Visual C++ 2013 Professional (C)' ... ... Looking for registry setting 'HKLM\SOFTWARE\Microsoft\VisualStudio\SxS\VS7' 12.0 ...Yes ('C:\Program Files (x86)\Microsoft Visual Studio 12.0\'). ... Looking for file 'C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\bin\amd64\cl.exe' ...Yes. ... Looking for folder 'C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC' ...Yes. ... Looking for registry setting 'HKLM\SOFTWARE\Microsoft\Microsoft SDKs\Windows\v8.1' InstallationFolder ...No. ... Looking for registry setting 'HKCU\SOFTWARE\Microsoft\Microsoft SDKs\Windows\v8.1' InstallationFolder ...No. ... Looking for registry setting 'HKLM\SOFTWARE\Wow6432Node\Microsoft\Microsoft SDKs\Windows\v8.1' InstallationFolder ...Yes ('C:\Program Files (x86)\Windows Kits\8.1\'). ... Looking for registry setting 'HKLM\SOFTWARE\Microsoft\VisualStudio\SxS\VS7' 12.0 ...Yes ('C:\Program Files (x86)\Microsoft Visual Studio 12.0\'). ... Looking for registry setting 'HKLM\SOFTWARE\Microsoft\VisualStudio\SxS\VC7' 12.0 ...No. ... Looking for registry setting 'HKCU\SOFTWARE\Microsoft\VisualStudio\SxS\VC7' 12.0 ...No. ... Looking for registry setting 'HKLM\SOFTWARE\Wow6432Node\Microsoft\VisualStudio\SxS\VC7' 12.0 ...Yes ('C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\'). ... Looking for environment variable 'VS120COMNTOOLS' ...Yes ('C:\Program Files (x86)\Microsoft Visual Studio 12.0\Common7\Tools\'). ... Looking for file 'C:\Program Files (x86)\Microsoft Visual Studio 12.0\Common7\IDE\devenv.exe' ...Yes. ... Looking for registry setting 'HKLM\SOFTWARE\Microsoft\VisualStudio\SxS\VS7' 12.0 ...Yes ('C:\Program Files (x86)\Microsoft Visual Studio 12.0\'). ... Looking for file 'C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\vcvarsall.bat' ...Yes. ... Looking for folder 'C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC' ...Yes. Found installed compiler 'Microsoft Visual C++ 2013 Professional (C)'. MEX configured to use 'Microsoft Visual C++ 2013 Professional (C)' for C language compilation. Warning: The MATLAB C and Fortran API has changed to support MATLAB variables with more than 2^32-1 elements. In the near future you will be required to update your code to utilize the new API. You can find more information about this at: http://www.mathworks.com/help/matlab/matlab_external/upgrading-mex-files-to-use-64-bit-api.html.
To choose a different language, select one from the following: mex -setup C++ mex -setup FORTRAN
Help is appreciated.

Accepted Answer

Ken Atwell
Ken Atwell on 5 Dec 2014
Can you check that you can create 64-bit executables from within Visual Studio 2010 (and if not, install the necessary components)? From this log, if looks like MEX found the VS2010 installation (well, the VS100COMNTOOLS environment variable at least), but not the 64-bit compiler itself, which MEX is expecting to find at:
C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\bin\amd64\cl.exe
  1 Comment
Waleed El-Badry
Waleed El-Badry on 7 Dec 2014
Thanks Ken for your response.
I figured out the problem based on your insightful note. VC++ 2010 express edition doesn't have 64-bit exe and therefore what I did to be a record for others:
  • Uninstalled Visual C++ 2010 Express and any 2010 update or redistribute packages.
  • I downloaded Windows 7 SDK and installed it. I made sure VC++ 2010 compiler is selected.
  • I installed then VC++ 2010 Express again. It appeared on MATLAB selection therafter.

Sign in to comment.

More Answers (0)

Categories

Find more on Troubleshooting in MATLAB Compiler SDK 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!