
Open D:\MATLAB\R2018b\bin\win64\mexopts msvc2019.xml, msvcpp2019.xml (choose according to your own vs version) two files, find two places, compare your VS installation path View Image View Image. Run mex -setup -v again, if the following figure appears, it means that the registry is resolved, but there is a path problem that has not been resolved. In the same way, open the "16.0" string under the "HKCU\SOFTWARE\Microsoft\VisualStudio\SxS\VS7" key of the registry, and assign the address of the "VC" file directory in the "Visual Studio" installation directory to it.
Find "HKLM\SOFTWARE\Microsoft\VisualStudio\SxS\VS7" in the registry,Īnd create a corresponding entry in the corresponding directory if not, as shown in the figure, I don’t have these paths, but I added them myself.
Take the first item as an example, "HKLM" means HKEY_LOCAL_MACHINE in the registry "HKCU" means HKEY_CURRENT_USER in the registry. Enter the troubleshooting stage, enter the registry, press "win+r" on the keyboard, enter "regedit" to open the registry, and look for them one by one. You can see whether it is in the back or not. Since there was no screenshot at the time, don't look at the VS2019 part of this picture. Run mex -setup -v in the MATLAB command line. There are these versions Īfter putting it in, you can open MATLAB and try the mex -setup command again. If you don’t have it, you can download the files here. If you have your VS version, don’t worry about it. See if you have your VS version, mine is VS2019, so I put the 2019 xml file in View Image. First enter the folder, D:\MATLAB\R2018b\bin\win64\mexopts (find it according to the MATLAB installation path you chose). In theory, my solution is applicable to all versions It prompted me to install the MinGW-w64 C/C++ compiler, but I installed VS2019, so I don't want to install another compiler if I am stubborn. however! ! ! Still not working, vomiting blood.
Very distressed, so I uninstalled and reinstalled a matlab2018b, I thought it would work. I read a lot of solutions on the Internet and found that the problem still cannot be solved. However, when I run the mex -setup command in matlab, this error appears. Matlab 2014b is installed first, and VS2019 View Image installed later. I installed matlab, VS2019 is not in the default path, and my MATLAB is on the D drive, and my VS2019 is on the E drive Root of the problem, the installation path problems caused by errors, and MATLAB does not automatically recognize the path changes It is also the most fatal and difficult problem.
This article may help you solve problems that are not mentioned in most other articles. Indicates that mex has not found a supported compiler or SDK. Many people have encountered that running mex -setup in matlab