MATLAB: Mcc error with directories including spaces in their names

directorymccnamespaces

I am trying to compile the simple 'HelloWorld' application with the lcc compiler in Windows 7 and I get an error that seems related to spaces in the name of directories.
This is what I get:
————————————————————–
>> mcc -mv helloworld.m
MATLAB:I18n:InconsistentLocale - The system locale setting, en_US.1252, is different from the user locale setting, en_GB.1252.
Compiler version: 4.13 (R2010a)
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.
2 item(s) added.
Generating MATLAB path for the compiled application...
Created 39 path items.
Begin validation of MEX files: Fri Jan 27 12:39:05 2012
End validation of MEX files: Fri Jan 27 12:39:05 2012
Parsing file "C:\matExe\helloworld.m"
(Referenced from: "Compiler Command Line").
Parsing file "C:\Program Files (x86)\MATLAB\R2010a\toolbox\compiler\deploy\deployprint.m"
(Referenced from: "Compiler Command Line").
Parsing file "C:\Program Files (x86)\MATLAB\R2010a\toolbox\compiler\deploy\printdlg.m"
(Referenced from: "Compiler Command Line").
Deleting 0 temporary MEX authorization files.
Generating file "helloworld_main.c".
Generating file "helloworld_delay_load.c".
Generating file "C:\matExe\readme.txt".
Generating file "helloworld_mcc_component_data.c".
Executing command: ""C:\Program Files (x86)\MATLAB\R2010a\bin\mbuild" -O -v -output "helloworld" "helloworld_main.c" "helloworld_delay_load.c" "helloworld_mcc_component_data.c" -link exe -env MCR_DELAYLOAD=/delayload:mclmcrrt713.dll -env MCR_DELAYLIB=delayimp.lib"
This is mbuild Copyright 1984-2006 The MathWorks, Inc.
-> Default options filename found in C:\Users\Riccardo Rampini\AppData\Roaming\MathWorks\MATLAB\R2010a —————————————————————- -> Options file = C:\Users\Riccardo Rampini\AppData\Roaming\MathWorks\MATLAB\R2010a\compopts.bat -> COMPILER = lcc -> Compiler flags: COMPFLAGS = -c -Zp8 -I"C:\Program Files (x86)\MATLAB\R2010a\sys\lcc\include" -noregistrylookup OPTIMFLAGS = -DNDEBUG DEBUGFLAGS = -g4 arguments = Name switch = -Fo -> Pre-linking commands = -> LINKER = lcclnk -> Link directives: LINKFLAGS = -tmpdir "." -L"C:\Program Files (x86)\MATLAB\R2010a\sys\lcc\lib" -libpath "C:\Program Files (x86)\MATLAB\R2010a\extern\lib\win32\lcc" LINKFLAGSPOST = mclmcrrt.lib Name directive = -o "helloworld.exe" File link directive = Lib. link directive = Rsp file indicator = @ -> Resource Compiler = -> Resource Linker = —————————————————————-
–> lcc -c -Zp8 -I"C:\Program Files (x86)\MATLAB\R2010a\sys\lcc\include" -noregistrylookup -Fo"C:\USERS\RICCARDO RAMPINI\APPDATA\LOCAL\TEMP\MBUILD_YNPRPF\helloworld_main.obj" -I"C:\Program Files (x86)\MATLAB\R2010a"\extern\include -DNDEBUG helloworld_main.c
–> lcc -c -Zp8 -I"C:\Program Files (x86)\MATLAB\R2010a\sys\lcc\include" -noregistrylookup -Fo"C:\USERS\RICCARDO RAMPINI\APPDATA\LOCAL\TEMP\MBUILD_YNPRPF\helloworld_delay_load.obj" -I"C:\Program Files (x86)\MATLAB\R2010a"\extern\include -DNDEBUG helloworld_delay_load.c
–> lcc -c -Zp8 -I"C:\Program Files (x86)\MATLAB\R2010a\sys\lcc\include" -noregistrylookup -Fo"C:\USERS\RICCARDO RAMPINI\APPDATA\LOCAL\TEMP\MBUILD_YNPRPF\helloworld_mcc_component_data.obj" -I"C:\Program Files (x86)\MATLAB\R2010a"\extern\include -DNDEBUG helloworld_mcc_component_data.c
Contents of C:\USERS\RICCARDO RAMPINI\APPDATA\LOCAL\TEMP\MBUILD_YNPRPF\mbuild_tmp.rsp:
"C:\USERS\RICCARDO RAMPINI\APPDATA\LOCAL\TEMP\MBUILD_YNPRPF\helloworld_main.obj" "C:\USERS\RICCARDO RAMPINI\APPDATA\LOCAL\TEMP\MBUILD_YNPRPF\helloworld_delay_load.obj" "C:\USERS\RICCARDO RAMPINI\APPDATA\LOCAL\TEMP\MBUILD_YNPRPF\helloworld_mcc_component_data.obj"
–> lcclnk -o "helloworld.exe" -tmpdir "." -L"C:\Program Files (x86)\MATLAB\R2010a\sys\lcc\lib" -libpath "C:\Program Files (x86)\MATLAB\R2010a\extern\lib\win32\lcc" @C:\USERS\RICCARDO RAMPINI\APPDATA\LOCAL\TEMP\MBUILD_YNPRPF\MBUILD_TMP.RSP mclmcrrt.lib
impossible to open C:\USERS\RICCARDO
C:\PROGRAM FILES (X86)\MATLAB\R2010A\BIN\MEX.PL: Error: Link of 'helloworld.exe' failed.
Error: An error occurred while shelling out to mbuild (error code = 2). Unable to build executable. ??? Error using ==> mcc Error executing mcc, return status = 1 (0x1).
————————————————————-
It seems that the error is generated by the fact that a directory is not found ("impossible to open C:\USERS\RICCARDO" but actually the directory is missing part of its name (i.e. my surname)
Could someone help me?
Riccardo

Best Answer

It looks like the issue is because of spaces in your $TEMP directory - see Bug Report# 708703. Perhaps you could set your TEMP environment directory to a folder without spaces as a workaround (or, slightly more advanced, modify the mbuild options file as the Bug Report suggests).