.net assembly - I have trouble using mcc compiler in MATLAB (Error using ==> mcc The output directory does not exist) -
i'm trying build .net assembly file executing code in matlab2010b
workdir = 'c:\users\h\documents\source code\matlabfiles'; outdir = fullfile(workdir, 'output'); dnetdir = fullfile(workdir, 'dotnet'); %% determine file names mfile = fullfile(workdir, 'perform.m'); dnetdll = fullfile(dnetdir, 'dotnet.dll'); %% create directories if needed if (exist(outdir, 'dir') ~= 7) mkdir(outdir); end if (exist(dnetdir, 'dir') ~= 7) mkdir(dnetdir); end %% build .net assembly eval(['mcc -n -d ' dnetdir ' -w ''dotnet:dotnet,' ... 'dotnetclass,0.0,private'' -t link:lib ' mfile]);
i'm getting error.
??? error using ==> mcc output directory, 'c:\users\h\documents\project\thesis\source' not exist.
i'm pretty sure it's because of space in directory path "...\source code\...". because if use path no spaces works fine.
is there way make work?
thank you.
i think actual problem occurs eval statement. build string evaluate concatenating strings dnetdir
, mfile
, each of have file path space in it. resulting string pass eval this:
mcc -n -d c:\users\h\documents\source code\matlabfiles\dotnet -w ... ^--look @ ugly space!
what need build string there apostrophes around these paths, this:
eval(['mcc -n -d ''' dnetdir ''' -w ''dotnet:dotnet,' ... 'dotnetclass,0.0,private'' -t link:lib ''' mfile '''']);
which result in string looks this:
mcc -n -d 'c:\users\h\documents\source code\matlabfiles\dotnet' -w ...
and evaluated nasty space in there.
Comments
Post a Comment