MEX doesn't work on Windows 10, 64bit

14 views (last 30 days)
Siamak Zamani
Siamak Zamani on 18 Oct 2015
Commented: luis velez on 17 Jun 2019
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 Comments
Dang Manh Truong
Dang Manh Truong on 22 Jan 2017
I downloaded the file, but it says you need Microsoft SDK 7.1 to install! This looks like a circular requirement !!!

Sign in to comment.

Answers (7)

Scooby921
Scooby921 on 2 Nov 2017
Edited: Scooby921 on 2 Nov 2017
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 Comment
burak ergocmen
burak ergocmen on 26 Nov 2017
for R2014a can problem solved with this method? . (Mex problem is really painful . After several attempts and several days ., there is no outcome ).

Sign in to comment.


Walter Roberson
Walter Roberson on 18 Oct 2015
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.
  1 Comment
burak ergocmen
burak ergocmen on 26 Nov 2017
I think the same problem with R2014a with the windows10 . Is it ?

Sign in to comment.


yavuz abut
yavuz abut on 20 Mar 2019
Edited: yavuz abut on 20 Mar 2019
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 Comment
luis  velez
luis velez on 17 Jun 2019
Exellent Yavuz , i tried your solution, and it Works!!....mex are functional, and i can use loadlibrary. THANKS!!!.....
DETAILS :
Matlab2015a 64bbits
Windows 10

Sign in to comment.


Marcel Nunez
Marcel Nunez on 20 Jan 2016
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 on 23 May 2016
Edited: Sri Sadhan j on 26 Jun 2016
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 Comment
Hyunkyu
Hyunkyu on 7 Jul 2016
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.

Sign in to comment.


Perez Lilian
Perez Lilian on 1 Apr 2018
Edited: Walter Roberson on 1 Apr 2018
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 on 9 Jul 2018
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 Comments
Jojo Wang
Jojo Wang on 5 Sep 2018
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 on 5 Sep 2018
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

Sign in to comment.

Categories

Find more on Introduction to Installation and Licensing 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!