Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

mcc -m compile ???

2 views
Skip to first unread message

kak3012

unread,
Nov 13, 2004, 8:45:48 AM11/13/04
to
Hi,

I do compile my MATLAB code with the option

mcc -m myfun.m

When I run the EXE file it asks for DLL files from MATLAB, which I can
understand why, but I do not understand why it is extrackting the whole code
into a directory first.

Isnt it the idea of compile is to run on single EXE file in MCC???

TIA

Ron Legere

unread,
Nov 13, 2004, 9:18:38 AM11/13/04
to
The new compiler works a bit differently.... read the help to understand
the way it works. As for your error,
the exe file needs to find the runtime dll's, and to do that
you have to tell Windows where they are. The docs tell you how
to fix this too.

Cheers!

kak3012

unread,
Nov 13, 2004, 11:58:07 AM11/13/04
to
But Ron,

When I amde a EXE file and move it to another computer and run it, it
creates a directory and extract the m files into it.

So why did I compile if the source code can be seen????

that is my problem.

F

"Ron Legere" <leg...@ll.mit.edu>, iletide sunu yazdi
news:SIold.54$1T1...@llnews.ll.mit.edu...

Ron Legere

unread,
Nov 14, 2004, 9:02:38 AM11/14/04
to
Did you try to look at the m files? They are encrypted, and cannot be
read.

Why do you compile? Two main reasons:
- To create a stand alone version of your program (including GUI
programs) to distribute to non-matlab users
- To create libraries you can call from C / C++ code.

The Matlab compiler ~used~ to create C code from your matlab code,
but not anymore. Now it creates a small wrapper function in C and
packages up and encrypts your m-files. The wrapper function calls
the appropriate dlls in the Matlab Component Runtime that extracts
the m-files and runs your application.

At least thats how I understand it. It's not really a 'compiler' anymore
(i.e. there is no code translation!) but it does what it claims.
You can read more at:

http://www.mathworks.com/products/compiler/description1.html

On what needs to go to another machine to distribute a stand alone:

http://www.mathworks.com/access/helpdesk/help/toolbox/compiler/ch01intro17.html


It seems to work pretty well for me so far....


Ron

0 new messages