Thread Subject: compile to exe

Subject: compile to exe

From: hailiang shen

Date: 18 Jun, 2009 23:01:02

Message: 1 of 3

Hi All,

I am trying to compile a project, including a .m file, a .dll file, and a .mex file. The m file calls function in dll and mex file. Is it possible to compile them into one .exe file?

Thanks,

Hailiang

Subject: compile to exe

From: Mark Hayworth

Date: 18 Jun, 2009 23:27:01

Message: 2 of 3

"hailiang shen" <hlshen2005@gmail.com> wrote in message <h1egve$ag1$1@fred.mathworks.com>...
> Hi All,
>
> I am trying to compile a project, including a .m file, a .dll file, and a .mex file. The m file calls function in dll and mex file. Is it possible to compile them into one .exe file?
>
> Thanks,
>
> Hailiang
-----------------------------------------------------
Not in my experience. It will bundle in all m files that the main m file calls but not the DLLs and mex files. You will have to ship those separately along with your m-file's exe. Bundle all those up using an installer program (such as Wise or Install Shield or many others), along with sample data files, documentation, mat files, Excel templates, and whatever other ancillary files you want to distribute with your package.

Subject: compile to exe

From: Bruno Luong

Date: 19 Jun, 2009 06:34:01

Message: 3 of 3

"Mark Hayworth" <hayworth@none.com> wrote in message <h1eig5$dm2$1@fred.mathworks.com>...
> "hailiang shen" <hlshen2005@gmail.com> wrote in message <h1egve$ag1$1@fred.mathworks.com>...
> > Hi All,
> >
> > I am trying to compile a project, including a .m file, a .dll file, and a .mex file. The m file calls function in dll and mex file. Is it possible to compile them into one .exe file?
> >
> > Thanks,
> >
> > Hailiang
> -----------------------------------------------------
> Not in my experience. It will bundle in all m files that the main m file calls but not the DLLs and mex files. You will have to ship those separately along with your m-file's exe. Bundle all those up using an installer program (such as Wise or Install Shield or many others), along with sample data files, documentation, mat files, Excel templates, and whatever other ancillary files you want to distribute with your package.

Well from my experiences, it seems DLL (old MEX format?) and MEX files (both are called from M-files as OP specified) should be recognized by the compiler dependency analyzer and automatically packed together during the compilation.

Now, if the a DLL is used by the MEX file, then you need to manually bundle them separately as Mark suggested, or you might try to trick the compiler by make it recognize as old-MEX format with the pragma %#function, or using MCC option "-a".

You might want to modify PATH environment to tell the deployed machine where to look for the DLL.

Bruno

Tags for this Thread

Everyone's Tags:

Add a New Tag:

Separated by commas
Ex.: root locus, bode

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Tag Activity for This Thread
Tag Applied By Date/Time
compile Sprinceana 22 Jun, 2009 04:37:05
m and mex file Sprinceana 22 Jun, 2009 04:37:05
m file Sprinceana 22 Jun, 2009 04:37:05
mex file Sprinceana 22 Jun, 2009 04:37:05
rssFeed for this Thread

Contact us at files@mathworks.com