MEX doesn't work on Windows 10, 64bit

16 次查看(过去 30 天)
I have a Matlab 2015a on my Windows 10. I cannot build mex files because Matlab can't recognize any compiler on my computer. I tried to install SDK 7, but it requires .NET framework 4, while .NET framework 4.5 is already installed on windows 10 and thus SDK 7 is not able to install visual C++ compiler. I wonder why Matlab team don't move on from SDK 7!
A lot of people have reported this problem, but I couldn't find any workaround. Do anybody know a solution?
  3 个评论
Dang Manh Truong
Dang Manh Truong 2017-1-22
I downloaded the file, but it says you need Microsoft SDK 7.1 to install! This looks like a circular requirement !!!

请先登录,再进行评论。

回答(7 个)

Scooby921
Scooby921 2017-11-2
编辑:Scooby921 2017-11-2
Another possible solution...
While I haven't yet tried to compile with Matlab I did successfully install the SDK 7.1 compiler on a Windows 10 machine and link it to 64-bit R2014b. Just got a new laptop at work and have been loading up all of the "old" software that I need to use for development. Won't have time to test until everything else is done.
**Windows 10 .NET 4.6 Frameworks is installed and active during this process.
1.) Uninstall all instances of Visual C ++ from the Programs list
2.) Download the iso image for SDK 7.1
!! GRMSDK_EN_DVD is the 32 bit version the added "X" in GRMSDKX_EN_DVD apparently indicates 64 bit.
3.) Unzip or mount the iso, but DO NOT use the Autorun or the "setup" executable in the root directory. Go into the Setup folder and run the "SDKSetup" application.
4.) Once you get to the list of selecting what components to install uncheck the box for Visual C ++ 2010 at the bottom.
The web installer for SDK doesn't work, nor does the main "setup" application mentioned above in the root of the iso. I think both start a background check of installed items and decide something newer than .NET 4 is installed. Directly running the "SDKSetup" application seems to bypass this and forces it to install. Running mex -setup afterward in Matlab results in confirmation that SDK 7.1 compiler is linked.
Opening whatever version of Matlab you're using will immediately reinstall whatever versions of Visual C ++ it wants installed. Likewise opening or repairing other application installs will get you back to where you need to be regarding all the different versions everyone seems to want to require for their particular tool.
  1 个评论
burak ergocmen
burak ergocmen 2017-11-26
for R2014a can problem solved with this method? . (Mex problem is really painful . After several attempts and several days ., there is no outcome ).

请先登录,再进行评论。


Walter Roberson
Walter Roberson 2015-10-18
MATLAB R2015a was designed and released before Windows 10. It is not reasonable to expect Mathworks to go back and change a previous product in response to a new Microsoft operating system that came afterwards.
The bug is on Microsoft's side, and they do not appear to be in a hurry to fix it.
MATLAB R2015b can work with Windows 10 with a compiler.

yavuz abut
yavuz abut 2019-3-20
编辑:yavuz abut 2019-3-20
1. Uninstall ALL Visual C++ Redistributables from the control panel first.
2. Download the corresponding offline ISO image from the Windows SDK archive.
3. After mounting the image, open F:\Setup\SDKSetup.exe directly.
  1 个评论
luis  velez
luis velez 2019-6-17
Exellent Yavuz , i tried your solution, and it Works!!....mex are functional, and i can use loadlibrary. THANKS!!!.....
DETAILS :
Matlab2015a 64bbits
Windows 10

请先登录,再进行评论。


Marcel Nunez
Marcel Nunez 2016-1-20
I do not think there is a solution for Windows 10.
The .NET Frameworks are built into the Windows 10 OS, so it is difficult to remove them so that .NET Framework 4 can be installed.
After 8 hours of trying to find a fix, I just installed Windows 8 in a separate partition for the sole purpose of being able to use mex files in Matlab.

Sri Sadhan j
Sri Sadhan j 2016-5-23
编辑:Sri Sadhan j 2016-6-26
I had same problem with the installation. This is what I did:
1) Uninstall all .NET frameworks.
2) Download the windows sdk 7.1 and start the installation procedure ( don't worry about the .NET error).
During the installation:
a) Untick Microsoft Visual C++ 2010 under the Redistributable Packages
b) Untick Visual C++ compilers under Windows Native Code Developement.
and proceed.
3) Go and install 'Microsoft Visual C++ 2013 Professional'.
4) mex -setup C++ will show up the options. Select 'Microsoft Visual C++ 2013 Professional' as the compiler.
I think a pc restart is required. For some reason the above method worked for me.
  1 个评论
Hyunkyu
Hyunkyu 2016-7-7
I had same problem and I solved this problem with 'Microsoft Visual C++ 2010 Professional' instead of 'Microsoft Visual C++ 2013 Professional'. PC restart was not required in my case. Thanks for solution.

请先登录,再进行评论。


Perez Lilian
Perez Lilian 2018-4-1
编辑:Walter Roberson 2018-4-1
En suivant la procédure suivante cela a marché pour moi ..., https://fr.mathworks.com/support/bugreports/1741173, j'ai pris le fichier zip suivant: attachment_1741173_13b_through_17a_win64_2018-03-08.zip

Tuncay  ÖLÇER
Tuncay ÖLÇER 2018-7-9
I have windows 8 and Matlab R2016b. And also I have got exactly the same problem. I tried all the solutions mentioned above, still no progress. When I try install Visual C++ Compiler using web installer of SDK, the choice for Visual C++ Compiler comes as not enabled and it is impossible to make it enable. It claims that .NET framework 4 is not installed but it is already installed. I have to use this compiler for my matlab mex setup and it seems it is impossible to make it work. Is there any one who knows a way to solve it? Thank you
  2 个评论
Jojo Wang
Jojo Wang 2018-9-5
I've got this problem too,while I solved it after some troubleshooting steps by installing a new matlab.
  • Operating System: Windows 10 64bit;
  • C++ Compiler: Visual Studio 2015 professional;
  • Matlab Version: Matlab R2013a
  • Problems: same with @Siamak Zamani 's( require SDK 7.1 and .NET framework 4)
I solved this problem by finally installing a new matlab version(matlab r2018a) which is fit with windows 10 and VS2015. As the official solution provided on this website (https://docs.microsoft.com/en-us/dotnet/framework/install/troubleshoot-blocked-installations-and-uninstallations) says that we'd better check which versions of the .NET Framework are installed on our system and find the right version of matlab.
Tuncay  ÖLÇER
Tuncay ÖLÇER 2018-9-5
Thank you very much for the answer. I finally solved the problem by installing a full licensed version of:
  • Visual Studio 2015 Professional with C++
  • Assign Matlab r2016b compiler to this C++ Compiler which is installed using Visual Studio 2015 Professional

请先登录,再进行评论。

类别

Help CenterFile Exchange 中查找有关 Introduction to Installation and Licensing 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by