0
votes

I am trying to create a Windows stand alone application in Matlab using the Deploytool to produce a .exe file for my project. (as mentioned here: http://www.mathworks.co.uk/products/demos/compiler/deploytool/index.html).

The problem is when in the Deploytool I add my files and press the Build button it asks me to use mbuild -setup to setup my compiler. When I do so the only options I get are :

Would you like mbuild to locate installed compilers [y]/n? n


    Select a compiler:   
    [1] Microsoft Visual C++ 2005 SP1   
    [2] Microsoft Visual C++ 2008 Express   
    [3] Microsoft Visual C++ 2008 SP1   
    [0] None

and when I choose any I get these:

*The default location for Microsoft Visual C++ 2008 Express compilers is C:\Program Files (x86)\Microsoft Visual Studio 9.0, 
but that directory does not exist on this machine.  
Please enter the location of your compiler:*

I also get the following error when I build:

*Could not find the compiler "cl" on the DOS path.
Use mbuild -setup to configure your environment properly.
C:\PROGRA~1\MATLAB\R2010A\BIN\MEX.PL: Error: Unable to locate compiler.
Error: An error occurred while shelling out to mbuild (error code = 2).
Unable to build executable.*

Can you please help me solve this problem.

Thanks in advance.

4
Which compilers do you have installed on your machine? What happens if you let "mbuild -setup" locate installed compilers?Edric
There is no option when I let it set up by itself. How should I install the compilers? do I need to get them specifically for matlab?Reyhaneh
You need a compiler installed, I believe the Visual Studio Express compiler can be obtained from Microsoft for no charge.Edric

4 Answers

1
votes

You need to allow mbuild to detect installed compilers. The Matlab compiler includes a default C compiler. On my Windows XP system, I get:

    >> mbuild -setup

Welcome to mbuild -setup.  This utility will help you set up  
a default compiler.  For a list of supported compilers, see  
http://www.mathworks.com/support/compilers/R2011a/win32.html 

Please choose your compiler for building standalone MATLAB applications: 

Would you like mbuild to locate installed compilers [y]/n? y

Select a compiler: 
[1] Lcc-win32 C 2.4.1 in C:\PROGRA~1\MATLAB\R2011a\sys\lcc 
[2] Microsoft Visual C++ 2010 in C:\Program Files\Microsoft Visual Studio 10.0 
[3] Microsoft Visual C++ 2005 SP1 in C:\Program Files\Microsoft Visual Studio 8 

[0] None 

Compiler:

I have two versions of Visual Studio installed, but you can see the default compiler is in the MATLAB installation directory.

Ensure you answer 'y' when the script asks to locate installed compilers

0
votes

You need to have a compiler installed on your computer. You can download Visual Studio Express from here: Visual Studio Express Download.

0
votes

I installed Microsoft Visual Studio Ultimate on my computer. When asked for the location of the compiler in mbuild setup, I redirected it to C:\Program Files (x86)\Microsoft Visual Studio 10.0. This worked for me.

0
votes
  • Go to following address {C:\Program Files\MATLAB\R2008a\toolbox\compiler\deploy\win32 }

    and install this following setup - "MCRInstaller.exe" (This setup file is use for set run time compiler) after install you can use "deployment tool" your respective file like *.Project.

Enjoy...