From: Dhiraj Singh on
Hi everyone, I am trying to build an executable file which can be run on computers which does not have matlab installed in it. I'm using Matlab-R2008A on Windows Vista and MS Visual Studio 2005. In order to learn this I tried following the instructions in the help example for creating a magic square application named mymagic.exe. But when I run the command mcc -m mymagic.m, I get the following output:

'mbuild' is not recognized as an internal or external command,
operable program or batch file.
Error: An error occurred while shelling out to mbuild (error code = 1).
Unable to build executable (specify the -v option for more information).
??? Error using ==> mcc
Error executing mcc, return status = 1.

On running mcc -m -v mymagic.m I get the following:

Compiler version: 4.8 (R2008a)
Processing E:\Program Files\Matlab installed\toolbox\matlab\mcc.enc
Processing include files...
2 item(s) added.
Processing directories installed with MCR...
The file mccExcludedFiles.log contains a list of functions excluded from the CTF archive.
1 item(s) added.
Generating MATLAB path for the compiled application...
Created 38 path items.
Begin validation of MEX files: Sun Jun 27 02:48:16 2010
Validating 'E:\Program Files\Matlab installed\toolbox\compiler\deploy\deploywhich.mexw32'.
No conflicting M-file found.
Validating 'E:\Program Files\Matlab installed\toolbox\compiler\deploy\readline.mexw32'.
No conflicting M-file found.
End validation of MEX files: Sun Jun 27 02:48:16 2010
Deleting 3 temporary MEX authorization files.
Removing: 'C:\Users\Dhiraj\AppData\Local\Temp\mathworks_tmp_5348_26262_5348.auth'.
Removing: 'C:\Users\Dhiraj\AppData\Local\Temp\mathworks_tmp_5348_16384_5348.auth'.
Removing: 'C:\Users\Dhiraj\AppData\Local\Temp\mathworks_tmp_5348_2900_5348.auth'.
Parsing file "C:\Users\Dhiraj\Desktop\mymagic.m"
(Referenced from: "Compiler Command Line").
Parsing file "E:\Program Files\Matlab installed\toolbox\compiler\deploy\deployprint.m"
(Referenced from: "Compiler Command Line").
Parsing file "E:\Program Files\Matlab installed\toolbox\compiler\deploy\printdlg.m"
(Referenced from: "Compiler Command Line").
Generating file "mymagic_main.c".
Generating file "C:\Users\Dhiraj\Desktop\readme.txt".
Generating file "mymagic_mcc_component_data.c".
Executing command: mbuild -O -v -output "mymagic" "mymagic_main.c" "mymagic_mcc_component_data.c" -link exe
'mbuild' is not recognized as an internal or external command,
operable program or batch file.
Error: An error occurred while shelling out to mbuild (error code = 1).
Unable to build executable.
??? Error using ==> mcc
Error executing mcc, return status = 1.

I have added the path matlabroot\bin in my environment variables but the problem still persists.
Can somebody please help in letting me know what extra settings are required to run the 'mbuild' and 'mcc' commands? Any kind of help and suggestions are welcome.
Thanking in anticipation!
Dhiraj
From: ImageAnalyst on
Dhiraj Singh:
Have you done the "mbuild -setup" command first, before you ever tried
to execute the compiler?
From: Dhiraj Singh on
Hey..Thanks for replying!
Yes I have done that. It asked me to choose a compiler.:
mbuild -setup
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 E:\PROGRA~1\MATLAB~1\sys\lcc
[2] Microsoft Visual C++ 2005 in C:\Program Files\Microsoft Visual Studio 8

[0] None

Compiler: 2

Please verify your choices:

Compiler: Microsoft Visual C++ 2005
Location: C:\Program Files\Microsoft Visual Studio 8

Are these correct [y]/n? y

Trying to update options file: C:\Users\Dhiraj\AppData\Roaming\MathWorks\MATLAB\R2008a\compopts.bat
From template: E:\PROGRA~1\MATLAB~1\bin\win32\mbuildopts\msvc80compp.bat

Done . . .
I even tried using the first one(Lcc) but it doesn't help.
From: ImageAnalyst on
You bought the toolbox so that means that you can get telephone help
from them. I suggest you call them. To me, the key lines in the
error message are these:

'mbuild' is not recognized as an internal or external command,
operable program or batch file.

and

The file mccExcludedFiles.log contains a list of functions excluded
from the CTF archive.
1 item(s) added.

I don't know why it says that it doesn't know mbuild when you have
obviously used it. So that's a puzzler. Otherwise I would have said
that it can't build the executable because it can't include some file,
which is listed in your mccExcludedFiles.log file. Have you looked in
that? But if that were the case, it should just say that it can't
build the executable, not that it doesn't know the command mbuild.
Good luck...




From: Dhiraj Singh on
Hi
My problem is solved now.
I uninstalled MS Visual studio and chose Lcc as my default compiler for mbuild and while running the command mcc I dropped the file extension .m and it worked fine.
Thanks for the replies.
Dhiraj