tags:

views:

90

answers:

2

Hi all,
For some MATLAB code that I want to make executable, I need the location to a compiler in Windows. I have Visual Studio installed, so would I be able to reference the compiler that that uses? If so, how can I find it?

Thanks.

+5  A: 

Run the "Visual Studio Command Prompt", and you'll have the environment setup for compilation.

Reed Copsey
Or if you need to start the shell from MatLab not the shortcut Reed mentioned, run vcvars.bat, which will set the environment correctly to compile.
Ben Voigt
After running it, I realized where the cl.exe file is, and was able to use that path successfully.
Michael
A: 

You don't even have to Run the "Visual Studio Command Prompt". When you install Visual Studio, it sets the environment variable: VS90COMNTOOLS.

Using that variable, you can figure out that "%VS90COMNTOOLS%....\VC\bin" points to the directory that contains the compiler. So to invoke the compiler you can use: "%VS90COMNTOOLS%....\VC\bin\cl.exe".

Note the use quotes. This is because the VS90COMNTOOLS has spaces in it if you take the default install location under %ProgramFiles% or %ProgramFiles%(x86).

Ants