<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0">
  <channel>
    <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/254109</link>
    <title>MATLAB Central Newsreader - compile to exe</title>
    <description>Feed for thread: compile to exe</description>
    <language>en-us</language>
    <copyright>&amp;copy;1994-2012 by MathWorks, Inc.</copyright>
    <webmaster>webmaster@mathworks.com</webmaster>
    <generator>MATLAB Central Newsreader</generator>
    <docs>http://blogs.law.harvard.edu/tech/rss</docs>
    <ttl>60</ttl>
    <image>
      <title>MathWorks</title>
      <url>http://www.mathworks.com/images/membrane_icon.gif</url>
    </image>
    <item>
      <pubDate>Thu, 18 Jun 2009 23:01:02 -0400</pubDate>
      <title>compile to exe</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/254109#658623</link>
      <author>hailiang shen</author>
      <description>Hi All, &lt;br&gt;
&lt;br&gt;
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? &lt;br&gt;
&lt;br&gt;
Thanks,&lt;br&gt;
&lt;br&gt;
Hailiang</description>
    </item>
    <item>
      <pubDate>Thu, 18 Jun 2009 23:27:01 -0400</pubDate>
      <title>Re: compile to exe</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/254109#658628</link>
      <author>Mark Hayworth</author>
      <description>&quot;hailiang shen&quot; &amp;lt;hlshen2005@gmail.com&amp;gt; wrote in message &amp;lt;h1egve$ag1$1@fred.mathworks.com&amp;gt;...&lt;br&gt;
&amp;gt; Hi All, &lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; 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? &lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; Thanks,&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; Hailiang&lt;br&gt;
-----------------------------------------------------&lt;br&gt;
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.</description>
    </item>
    <item>
      <pubDate>Fri, 19 Jun 2009 06:34:01 -0400</pubDate>
      <title>Re: compile to exe</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/254109#658676</link>
      <author>Bruno Luong</author>
      <description>&quot;Mark Hayworth&quot; &amp;lt;hayworth@none.com&amp;gt; wrote in message &amp;lt;h1eig5$dm2$1@fred.mathworks.com&amp;gt;...&lt;br&gt;
&amp;gt; &quot;hailiang shen&quot; &amp;lt;hlshen2005@gmail.com&amp;gt; wrote in message &amp;lt;h1egve$ag1$1@fred.mathworks.com&amp;gt;...&lt;br&gt;
&amp;gt; &amp;gt; Hi All, &lt;br&gt;
&amp;gt; &amp;gt; &lt;br&gt;
&amp;gt; &amp;gt; 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? &lt;br&gt;
&amp;gt; &amp;gt; &lt;br&gt;
&amp;gt; &amp;gt; Thanks,&lt;br&gt;
&amp;gt; &amp;gt; &lt;br&gt;
&amp;gt; &amp;gt; Hailiang&lt;br&gt;
&amp;gt; -----------------------------------------------------&lt;br&gt;
&amp;gt; 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.&lt;br&gt;
&lt;br&gt;
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.&lt;br&gt;
&lt;br&gt;
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 &quot;-a&quot;.&lt;br&gt;
&lt;br&gt;
You might want to modify PATH environment to tell the deployed machine where to look for the DLL.&lt;br&gt;
&lt;br&gt;
Bruno</description>
    </item>
  </channel>
</rss>

