3

I know that Visual Studio Pro will allow you to compile mex files for MATLAB 2014b.

However I was wondering if anyone was able to use Visual Studio Express (which is free, as opposed to Pro which is not) to compile mex files? I tried the Windows SDK (recommended by mathworks), with no success.

Update: This is the error I get: A problem occurred while installing selected Windows SDK components. Installation of the "Microsoft Windows SDK for Windows 7" product has reported the following error: Please refer to Samples\Setup\HTML\ConfigDetails.htm

Only I can't find that file.

Details:

Windows 7

MATLAB 2014b

Things I Did So Far:

SDK 7.1, I tried installing this not sure if it did not install correctly or was not actually a solution (from here: http://www.mathworks.com/support/compilers/R2014b/index.html)

Download the 30 day trial of Visual Studio Pro which is working

ErinGoBragh
  • 336
  • 4
  • 20
  • If not necessarily MSVC, have you tried [gnumex](http://gnumex.sourceforge.net/)? I tested it successfully with `R2012b`, but not with `2014b`. Note also, that despite what's their [website](http://de.mathworks.com/support/compilers/R2014b/index.html) says, `R2014b` runs still with `MSVC 2005`. This is also what `mex.getCompilerConfigurations('c','Supported')` gives. – embert Feb 06 '15 at 19:03
  • Note: `Microsoft® Visual Studio® 2005` can be downloaded for free ( - as I think, did'nt check out myself). It does not support `c99`, just in case that is required. – embert Feb 06 '15 at 19:08
  • @embert Where can I find VS 2005? I went to the VS 2005 page (https://msdn.microsoft.com/en-us/library/ms950416.aspx) but the Visual Studios 2005 Express Edition link redirected to the 2013 edition (http://www.visualstudio.com/en-US/products/visual-studio-express-vs) – ErinGoBragh Feb 06 '15 at 19:18
  • Don't use a 10 year old compiler. Please! Try again with SDK 7.1 and check for [certain MS bugs that might cause a problem](http://stackoverflow.com/a/19105762/2778484). See here for supported compilers: http://www.mathworks.com/support/compilers/R2014b/index.html – chappjc Feb 06 '15 at 19:32
  • Try [here](http://www.microsoft.com/en-US/download/details.aspx?id=5553) or [here](http://download.cnet.com/Microsoft-Visual-Studio-2005-Standard-Edition/3000-2212_4-194622.html). Of course new compilers are better, I guess. But often something that works is better than something that's better but doesn't work. Ah..actually a have no clue about all those versions, that exist. So..be aware. – embert Feb 06 '15 at 19:41
  • What is the error? Express editions are not supported anymore. – chappjc Feb 06 '15 at 19:46
  • mex -setup always says that "No supported SDK or compiler was found" – ErinGoBragh Feb 06 '15 at 19:50
  • 1
    Try the MS hotfix from the answer I linked to above. This seems to be a common issue when certain updates. Also be sure select any options for 64-bir compilers if MATLAB is 64-bit. If all else fails, manually verify the SDK install worked. – chappjc Feb 06 '15 at 20:01

2 Answers2

2

Yes. I used to use that exact combination if I recall. Make sure you get the right version of it though. Share the actual problem and maybe we can work around it.

CodeMonkey
  • 1,795
  • 3
  • 16
  • 46
  • 1
    I'm going to go ahead and accept your answer since I can't roll back and reproduce these errors. I got a copy of Visual Studios Pro from my boss and so I will not be going back to Express to test this. I would like to thank you for your help anyway. I might be testing mex files for a few older versions of matlab in coming weeks and if I learn anything useful I will add it just for completeness. Thanks again, Erin – ErinGoBragh Feb 12 '15 at 13:31
1

This is another common issue with the Windows SDK 7.1 where it won't install if you have a newer Visual Studio 2010 runtime than version 10.0.30319, which is what it tries to install (you would think they would update the SDK installer!). You have to remove them before installing the SDK:

MsiExec.exe /passive /X{F0C3E5D1-1ADE-321E-8167-68EF0DE699A5}
MsiExec.exe /passive /X{1D8E6291-B0D5-35EC-8441-6616F567A0F7}

Then the SDK will install and you can reinstall the latest 2010 runtimes.

There is an identical issue with the old DirectX SDK (June 2010) and the solution is much the same.

Community
  • 1
  • 1
chappjc
  • 30,359
  • 6
  • 75
  • 132