<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0">
  <channel>
    <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/238545</link>
    <title>MATLAB Central Newsreader - Problem including svd, norm or qr in a win32 dll</title>
    <description>Feed for thread: Problem including svd, norm or qr in a win32 dll</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>Sun, 02 Nov 2008 01:59:02 -0500</pubDate>
      <title>Problem including svd, norm or qr in a win32 dll</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/238545#608552</link>
      <author>Tom Hall</author>
      <description>I have recently installed R2008b with the Matlab compiler.  When creating win32 .dlls using mcc -B csharedlib:&amp;lt;dllname&amp;gt; &amp;lt;M-file&amp;gt;, everything works fine except that any call within an M-file to svd, qr, or norm (possibly any matfun?) does not work correctly from the .dll.  Whenever a call to svd, qr or norm is encountered in the dll file, a dialog appears entitled &quot;mllapack.dll&quot; with the message &quot;The specified procedure could not be found.&quot;.  &lt;br&gt;
&lt;br&gt;
Other standard built-in functions (e.g. abs, sqrt, strcmp,find,  etc.) appear to work fine, and full libraries are OK as long as they don't use matfun functions (as far as I can tell so far).  However, even a two-line function with no input or output like the one below fails when compiled into a .dll and accessed by an external program.&lt;br&gt;
&lt;br&gt;
function test1()&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;input=[4 5 6; 6 7 8; 10 2 5];&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;test_out=svd(input);&lt;br&gt;
return;&lt;br&gt;
&lt;br&gt;
I'm just wondering if anyone else has run across this, and if so, if there's a solution?  It could be a configuration on my computer, but I can't figure it out.  I can't find any specific information in the documentation.&lt;br&gt;
&lt;br&gt;
Thanks for any help / advice.&lt;br&gt;
&lt;br&gt;
-Tom</description>
    </item>
    <item>
      <pubDate>Sun, 18 Apr 2010 00:00:22 -0400</pubDate>
      <title>Re: Problem including svd, norm or qr in a win32 dll</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/238545#737081</link>
      <author>Tom </author>
      <description>I just ran into the exact same problem. Were you able to solve this matter?&lt;br&gt;
&lt;br&gt;
My code runs fine in Matlab but the compiled program crashes on that mllapack.dll message.&lt;br&gt;
&lt;br&gt;
Quite frustrating...&lt;br&gt;
&lt;br&gt;
Thanks,&lt;br&gt;
&lt;br&gt;
Tom</description>
    </item>
    <item>
      <pubDate>Sun, 18 Apr 2010 06:58:08 -0400</pubDate>
      <title>Re: Problem including svd, norm or qr in a win32 dll</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/238545#737111</link>
      <author>Bruno Luong</author>
      <description>&quot;Tom &quot; &amp;lt;t_vanesch@yahoo.com&amp;gt; wrote in message &amp;lt;hqdi2m$rbo$1@fred.mathworks.com&amp;gt;...&lt;br&gt;
&amp;gt; I just ran into the exact same problem. Were you able to solve this matter?&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; My code runs fine in Matlab but the compiled program crashes on that mllapack.dll message.&lt;br&gt;
&amp;gt; &lt;br&gt;
&lt;br&gt;
I have encountered very similar problem under 2006B window (we still use this old version for our commercial product).&lt;br&gt;
&lt;br&gt;
In my case:&lt;br&gt;
- The issue seems to appear only at the very first call to a ML built_in matrix function&lt;br&gt;
- nothing crashes as long as the result will not be used by the program&lt;br&gt;
&lt;br&gt;
Based on that, I make a nasty workaround:&lt;br&gt;
- After initialization of my application, call a dummy DLL compiled function that in turn call ML QR, for example.&lt;br&gt;
- Then call my other DLLs as normal&lt;br&gt;
&lt;br&gt;
So far it works, but the &quot;solution&quot; is unsatisfied. I agree it's a pain.&lt;br&gt;
&lt;br&gt;
Bruno</description>
    </item>
    <item>
      <pubDate>Sun, 18 Apr 2010 15:35:05 -0400</pubDate>
      <title>Re: Problem including svd, norm or qr in a win32 dll</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/238545#737162</link>
      <author>Tom </author>
      <description>Thanks for the tip.&lt;br&gt;
But when I include a dummy function, as below, I get the &quot;crash&quot;and &quot;mllapack.dll&quot; message when the main program calls this function in the compiled program.&lt;br&gt;
&lt;br&gt;
&amp;gt;function DummyFunction()&lt;br&gt;
&amp;gt;    input=[4 5 6; 6 7 8; 10 2 5];&lt;br&gt;
&amp;gt;    test_out=svd(input);&lt;br&gt;
&amp;gt;return;&lt;br&gt;
&lt;br&gt;
Even when I compile this simple function as stand alone, it crashes too.&lt;br&gt;
&lt;br&gt;
When I use the dependency walker, I see that it finds and loads the mllapack.dll but that it calls an unknown function...&lt;br&gt;
&lt;br&gt;
Any other ideas or tips are welcome.</description>
    </item>
    <item>
      <pubDate>Tue, 20 Apr 2010 17:11:06 -0400</pubDate>
      <title>Re: Problem including svd, norm or qr in a win32 dll</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/238545#737770</link>
      <author>Tom </author>
      <description>I found that the error comes from a dll version problem (as suspected)&lt;br&gt;
&lt;br&gt;
an older &quot;libmmd.dll&quot; was present in windows/system32 directory.&lt;br&gt;
&lt;br&gt;
the version that comes with the Matalb Runtime bin/win32 directory was not used.&lt;br&gt;
&lt;br&gt;
Getting rid of the older version solved the problem.&lt;br&gt;
&lt;br&gt;
I haven't figured out yet why it was there and why it doesn't get updated in the windows directory when installing the vcredist.&lt;br&gt;
&lt;br&gt;
What a pain.</description>
    </item>
  </channel>
</rss>

