I'm a newbie with matlab compiler. I'm trying to compile a certain
set of M-Files and these m-files also require certain data
files(*.MAT).
When I compile using the following commands :
mcc -mv file1 file2....fileN data1.mat data2.mat
(LCC is my compiler)
I get the following error
data1.mat: unknown file type
C:\MATLAB\R2006A\BIN\MEX.PL: Error: Link of 'file1.exe' failed.
Error: An error occurred while shelling out to mbuild (error code =
1).
Unable to build executable.
??? Error executing mcc, return status = 1.
Can someone tell me what wrong am I doing ? I'm trying to create a
standalone application for my set of code.
Regards
Vivek
Caroline
unfortunately i'm facing the problem of not getting the compiled
version to work....
I used LCC to compile my code......I installed MCR to a appropriate
directory. The path to it has been added into my environ.
variables.... when i try to run the *.exe from command line, it gives
me the following error
"This application has failed to start becoz mclmcrrt74.dll was not
found. re-installing the application may fix the problem"
any clue as to why.....i have reinstalled MCR thrice.....
regards
vivek
your solution worked and for the other problem where the exe wasn't
able to execute bcoz it couldn't locate the *.dll file.
I solved it by copying all my *.exe/*.c & *.ctf files to a TEST
folder within the <MCRROOT>/v74/. Then it worked fine.....
cheers
vivek
I also specified LCC as my compiler in mbuild command.
mcc -m test1.m test2.m test3.m test4.m
Error: File "test1" is a script M-file and cannot be compiled with
the current Compiler.
??? Error executing mcc, return status = 1.
All the file are related, meaning from test1.m file i will call
test2,test3,test4.
Thanks.
Billy
Thats an error documented in the help file for MATLAB Compiler under
Error & Compile Messages.
Here's a link for coverting script files into function files
If i'm not wrong if your test1.m is a script file....
on the first line of the code if you type in
function test1
and then try to compile it....there should not be any errors....but
then again i would first suggest you to read the help file at the
above link....
cheers
vivek
I would also suggest you to use the "-v" option of mbuild so that you
can see all the messages while the compiler is building the
executable.
mcc -mv test1.m test2.m test3.m test4.m
cheers
vivek
Thanks for that, after i changed it to fuction, i got the following
error:
Could not locate mclmcrrt.lib
C:\MATLABSP2\BIN\WIN32\\..\WIN32\MEX.PL: Error: Link of 'test1.exe'
failed.
I have installed MCR, but i saw in help it is not necessary if matlab
is already installed. Inside the "bin" folder of MCR i can see
mclmcrrt72.lib
Thanks
Billy
here you go......
1. Install MCR Utility on your machine to run the executable.
2. Say MCR is installed into "C:\Program Files\MATLAB\MATLAB
Component Runtime\v74".
3. Create a NewFolder say - TEST in the directory where MCR was
installed in Step-1. Thus the location of directory "TEST" would
be "C:\Program Files\MATLAB\MATLAB Component Runtime\v74\TEST".
4. Copy all the files *.exe/*.c/*.ctf files to "TEST" directory.
5. Double Click on "*.exe" file. Once its done without giving any
errors, it will extract the required files and create a new
folder within the directory "TEST".
6. Copy all the required data(*.mat or *.dat) and image files to
the "work" folder within the NEWFOLDER created inside the
directory "TEST".
Now, there are 2 methods to run the code.
-----------------------
METHOD 1 - SHORTCUT
-----------------------
1. Double click the TEST.exe file to execute it.
-------------------------------
METHOD 2 - Using Command Prompt
-------------------------------
1. Click on WINDOWS START BUTTON(bottom left corner).
2. Click on RUN and type "cmd" and press ENTER.
3. On the command prompt make sure you just have the C:\> prompt.
Incase you have the prompt like this
c:\Some Directory\Some Other Directory>
Then keep typing "cd.." and ENTER till the prompt comes back to
c:\>
4. Now type in "cd Program Files\MATLAB\MATLAB Component
Runtime\v74\TEST". Your path may be different depending upon where
the MCR utility was installed and where you created the FOLDER for
keeping the executable files.
5. Now type in the name of your executable on the cmd prompt in my
case it looked like this
c:\Program Files\MATLAB\MATLAB Component Runtime\v74\TEST>TEST.exe
and press ENTER
6. The file should execute as expected.
cheers
vivek