当前位置:网站首页>[matlab 2016 use mex command to find editor visual studio 2019]

[matlab 2016 use mex command to find editor visual studio 2019]

2022-04-23 20:37:00 Zhongai0049

【Matlab2016 Use mex Command to find the editor Visual Studio2019】

Recently, I want to use VS and matlab Programming , But there's no way to make matlab find VS, After many inquiries , Specially recorded here .

problem :mex Command error

mex -setup
Misuse mex
No supported compiler or SDK. You can install the free MinGW-w64 C/C++ compiler ; See installation MinGW-w64 compiler . More options , Please visit http://www.mathworks.com/support/compilers/R2016b/win64.html.

It was found that the problem was caused by the inability to find the compiler , Therefore, the detailed mode is used to check the specific reasons , The order is as follows :

mex -setup -v
Detailed mode on .
… Looking for compiler ‘Intel C++ Composer XE 2013 with Microsoft SDK 7.1 ’…
… Looking for environment variables ‘ICPP_COMPILER14’… no .
… Looking for environment variables ‘ICPP_COMPILER13’… no .
No compiler installed found ‘Intel C++ Composer XE 2013 with Microsoft SDK 7.1 ’.
… Looking for compiler ‘Intel C++ Composer XE 2013 with Microsoft Visual Studio 2012 ’…
… Looking for environment variables ‘ICPP_COMPILER14’… no .
… Looking for environment variables ‘ICPP_COMPILER13’… no .
No compiler installed found ‘Intel C++ Composer XE 2013 with Microsoft Visual Studio 2012 ’.
… Looking for compiler ‘Intel C++ Composer XE 2013 with Microsoft Visual Studio 2013 ’…
… Looking for environment variables ‘ICPP_COMPILER14’… no .
… Looking for environment variables ‘ICPP_COMPILER13’… no .
No compiler installed found ‘Intel C++ Composer XE 2013 with Microsoft Visual Studio 2013 ’.
… Looking for compiler ‘Intel Parallel Studio XE 2015 with Microsoft SDK 7.1 ’…
… Looking for environment variables ‘ICPP_COMPILER15’… no .
No compiler installed found ‘Intel Parallel Studio XE 2015 with Microsoft SDK 7.1 ’.
… Looking for compiler ‘Intel Parallel Studio XE 2015 with Microsoft Visual Studio 2012 ’…
… Looking for environment variables ‘ICPP_COMPILER15’… no .
No compiler installed found ‘Intel Parallel Studio XE 2015 with Microsoft Visual Studio 2012 ’.
… Looking for compiler ‘Intel Parallel Studio XE 2015 with Microsoft Visual Studio 2013 ’…
… Looking for environment variables ‘ICPP_COMPILER15’… no .
No compiler installed found ‘Intel Parallel Studio XE 2015 with Microsoft Visual Studio 2013 ’.
… Looking for compiler ‘Intel Parallel Studio XE 2015 with Microsoft Visual Studio 2015 ’…
… Looking for environment variables ‘ICPP_COMPILER15’… no .
No compiler installed found ‘Intel Parallel Studio XE 2015 with Microsoft Visual Studio 2015 ’.
… Looking for compiler ‘Intel Parallel Studio XE 2016 with Microsoft SDK 7.1 ’…
… Looking for environment variables ‘ICPP_COMPILER16’… no .
No compiler installed found ‘Intel Parallel Studio XE 2016 with Microsoft SDK 7.1 ’.
… Looking for compiler ‘Intel Parallel Studio XE 2016 with Microsoft Visual Studio 2012 ’…
… Looking for environment variables ‘ICPP_COMPILER16’… no .
No compiler installed found ‘Intel Parallel Studio XE 2016 with Microsoft Visual Studio 2012 ’.
… Looking for compiler ‘Intel Parallel Studio XE 2016 with Microsoft Visual Studio 2013 ’…
… Looking for environment variables ‘ICPP_COMPILER16’… no .
No compiler installed found ‘Intel Parallel Studio XE 2016 with Microsoft Visual Studio 2013 ’.
… Looking for compiler ‘Intel Parallel Studio XE 2016 with Microsoft Visual Studio 2015 ’…
… Looking for environment variables ‘ICPP_COMPILER16’… no .
No compiler installed found ‘Intel Parallel Studio XE 2016 with Microsoft Visual Studio 2015 ’.
… Looking for compiler ‘MinGW64 Compiler ’…
… Looking for environment variables ‘MW_MINGW64_LOC’… no .
No compiler installed found ‘MinGW64 Compiler ’.
… Looking for compiler ‘Microsoft Visual C++ 2012 ’…
… Looking for registry settings ‘HKLM\SOFTWARE\Microsoft\VisualStudio\SxS\VS7’ 11.0… no .
… Looking for registry settings ‘HKCU\SOFTWARE\Microsoft\VisualStudio\SxS\VS7’ 11.0… no .
… Looking for registry settings ‘HKLM\SOFTWARE\Wow6432Node\Microsoft\VisualStudio\SxS\VS7’ 11.0… no .
… Looking for registry settings ‘HKCU\SOFTWARE\Wow6432Node\Microsoft\VisualStudio\SxS\VS7’ 11.0… no .
No compiler installed found ‘Microsoft Visual C++ 2012 ’.
… Looking for compiler ‘Microsoft Visual C++ 2013 Professional ’…
… Looking for registry settings ‘HKLM\SOFTWARE\Microsoft\VisualStudio\SxS\VS7’ 12.0… no .
… Looking for registry settings ‘HKCU\SOFTWARE\Microsoft\VisualStudio\SxS\VS7’ 12.0… no .
… Looking for registry settings ‘HKLM\SOFTWARE\Wow6432Node\Microsoft\VisualStudio\SxS\VS7’ 12.0… no .
… Looking for registry settings ‘HKCU\SOFTWARE\Wow6432Node\Microsoft\VisualStudio\SxS\VS7’ 12.0… no .
No compiler installed found ‘Microsoft Visual C++ 2013 Professional ’.
… Looking for compiler ‘Microsoft Visual C++ 2015 Professional ’…
… Looking for registry settings ‘HKLM\SOFTWARE\Microsoft\VisualStudio\SxS\VS7’ 14.0… yes (‘C:\Program Files (x86)\Microsoft Visual Studio 14.0’).
… Looking for files ‘C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\bin\amd64\cl.exe’… no .
No compiler installed found ‘Microsoft Visual C++ 2015 Professional ’.
Looking for compiler ‘Microsoft Visual C++ 2019 ’…
… Looking for registry settings ‘HKLM\SOFTWARE\Microsoft\VisualStudio\SxS\VS7’ 16.0… no .
… Looking for registry settings ‘HKCU\SOFTWARE\Microsoft\VisualStudio\SxS\VS7’ 16.0… no .
… Looking for registry settings ‘HKLM\SOFTWARE\Wow6432Node\Microsoft\VisualStudio\SxS\VS7’ 16.0… yes (‘C:\Program Files (x86)\Microsoft Visual Studio 16.0’).
… Executing order ‘set “vcroot=C:\Program Files (x86)\Microsoft Visual Studio 16.0”&for /f "delims= " %a in (‘type “C:\Program Files (x86)\Microsoft Visual Studio 16.0\VC\Auxiliary\Build\Microsoft.VCToolsVersion.default.txt”’) do @if exist “C:\Program Files (x86)\Microsoft Visual Studio 16.0\VC\Tools\MSVC%a\bin\HostX64\x64\cl.exe” call echo %vcroot%’… no .
No compiler installed found ‘Microsoft Visual C++ 2019 ’.

… Looking for compiler ‘Microsoft Windows SDK 7.1 ’…
… Looking for registry settings ‘HKLM\SOFTWARE\Microsoft\Microsoft SDKs\Windows\v7.1’ InstallationFolder… no .
… Looking for registry settings ‘HKLM\SOFTWARE\Wow6432Node\Microsoft\Microsoft SDKs\Windows\v7.1’ InstallationFolder… no .
No compiler installed found ‘Microsoft Windows SDK 7.1 ’.
Misuse mex
No supported compiler or SDK. You can install the free MinGW-w64 C/C++ compiler ; See installation MinGW-w64 compiler . of
More options , Please visit http://www.mathworks.com/support/compilers/R2016b/win64.html.

It is found that the bold part is that the compiler is not found VS2019 Why . because matlab Finding the compiler is usually through the registry to find the corresponding compiler and SDK.
Open the registry : Press down win+r key , Input regedit Open registry editor .
seek matlab The corresponding file method is as follows :
Mainly looking for two files :HKEY_CURRENT_USER and HKEY_LOCAL_MACHINE, They correspond to each other Matlab Medium HKCU and HKLM

according to MATLAB Error messages in , Corresponding search :
1. Find the way :’HKLM\SOFTWARE\Microsoft\VisualStudio\SxS\VS7’ 16.0‘
Add string : Insert picture description here
Right click to add a string , Name it 16.0, Change the value to VS2019 Installation directory .
————————————————
And then again in matlab Run in mex command : Found compiler VS2019, Just choose the language you want to use
Found compiler VS2019, Just choose the language you want to use .

Reference resources :1.Matlab2016 And above version settings VS compiler

2.vs2019+matlab2016b mex Not working properly , No compiler installed found

版权声明
本文为[Zhongai0049]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/04/202204210547163281.html