4
votes

I am trying to write C++ programs and integrate it with MATLAB using mex interface. I wrote mex -setup command on MATLAB and this was the result Select a compiler:

[0] None

I have Visual Studio 2010 installed on a Windows 7 64 bit PC with MATLAB R2009b installed (64bit). I read somewhere visual studio 2010 should have 64 bit compiler installed which is done. Can some one help me out please

3

3 Answers

4
votes

Could it be related to the fact that cl.exe is not in your %PATH ? Try fixing your PATH using the Options Panel on "My Computer" and try again

3
votes

You need to install both Visual Studio 2008 and the corresponding Windows SDK: http://www.mathworks.co.uk/support/compilers/R2009b/win64.html

Visual Studio 2010 isn't supported by R2009b. R2010a is the first that supports VS 2010.

0
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 the following procedure

Compiling mex files with Visual Studio

which has been tested with Visual Studio 2010, Matlab 2010a and for an Intel 64bit target machine.

There is also a Visual Studio 2010 project you can download and modify with your own configuration parameters, if needed.