3
votes

I'm trying to compile a mex file to use socket connection within matlab. The problem is that it is always saying that I don't have sdk or compiler installed. But I have installed visual studio 2010 express, visual studio 2012 express, visual studio 2012 professional and nothing is changing the error. Also I have installed the sdk. Is there anything that I could try? The matlab version is R2012b and I'm using windows 7, 64 bits.

Thanks!

5
I believe VS2012 Express does not come with a 64-bit compiler by default, so will not work for MEXing from 64-bit MATLAB. HAve you tried 32-bit MATLAB?wakjah

5 Answers

2
votes

You can try gnumex, which lets you access the mingw compilers on Windows. It works with mingw-w64 which is the 64 bit version of mingw. You have to install the mingw compiler suite, then run gnumex in Matlab to tell it where mingw is and set it up.

1
votes

I believe that Visual Studio 2012 is only supported on the latest R2013a. Use VS2010 for your MATLAB version.

In addition, the Express editions of VS do not contain 64-bit compilers. You need to either get the Professional edition, or download the free Windows SDK.

See the list of supported compilers for more information

1
votes

You are asking how to compile the mex-file directly on the Matlab's command line.

An alternative would be to compile the mex-file from Visual Studio. You might be interested in my answer to

No C++ compiler found in MATLAB using mex

0
votes

Have you run mex -setup to tell MATLAB which compiler you want to use?

See this page on Building MEX-Files for more information