<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0">
  <channel>
    <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/170417</link>
    <title>MATLAB Central Newsreader - Linking C++ and Matlab using VS2003</title>
    <description>Feed for thread: Linking C++ and Matlab using VS2003</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>Tue, 03 Jun 2008 21:59:02 -0400</pubDate>
      <title>Linking C++ and Matlab using VS2003</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/170417#435726</link>
      <author>Daniel Vogel</author>
      <description>I'm trying to run the engdemo.c program. &lt;br&gt;
I'm using MATLAB 2008a and Microsoft C++ Visual Studio 2003 on a &lt;br&gt;
Windows XP machine.&lt;br&gt;
&lt;br&gt;
At first I was getting the following error:&lt;br&gt;
error C2065: 'Engine' : undeclared identifier&lt;br&gt;
&lt;br&gt;
So i added the following line to my cpp file:&lt;br&gt;
#include &quot;C:/Program Files/MATLAB/R2008a/extern/include/engine.h&quot;&lt;br&gt;
&lt;br&gt;
But then I would start getting a couple of the following errors:&lt;br&gt;
error LNK2019: unresolved external symbol _engClose referenced in function &lt;br&gt;
_main&lt;br&gt;
&lt;br&gt;
So I added the following to my code:&lt;br&gt;
#pragma comment (lib,&quot;C:/Program Files/MATLAB/R2008a/extern/lib/win32/&lt;br&gt;
microsoft/libeng.lib&quot;)&lt;br&gt;
#pragma comment (lib,&quot;C:/Program Files/MATLAB/R2008a/extern/lib/win32/&lt;br&gt;
microsoft/libmx.lib&quot;)&lt;br&gt;
#pragma comment (lib,&quot;C:/Program Files/MATLAB/R2008a/extern/lib/win32/&lt;br&gt;
microsoft/libut.lib&quot;)&lt;br&gt;
&lt;br&gt;
This made the program link and compile. However, upon running the &lt;br&gt;
program, it would close with the following error:&lt;br&gt;
Unable to Locate Component&lt;br&gt;
This application has failed to start because libeng.dll was not found. Re-&lt;br&gt;
installing the application may fix the problem.&lt;br&gt;
&lt;br&gt;
So I copied libeng.dll from C:/Program Files/MATLAB/R2008a/bin/win32 to &lt;br&gt;
my project directory. It then asked me for another dll, which I also copied. &lt;br&gt;
This went on a couple of times until I got tired and copied over all the dlls in &lt;br&gt;
the win32 directory to my project directory. The program now opens and &lt;br&gt;
immediately crashes. A window pops up with the following message:&lt;br&gt;
Microsoft Visual C++ Runtime Library&lt;br&gt;
Runtime Error!&lt;br&gt;
Program: c:\Documents and...&lt;br&gt;
This application has requested the Runtime to terminate it in an unusual way. &lt;br&gt;
Please contact the application's support team for more information.&lt;br&gt;
&lt;br&gt;
The output on my project window says:&lt;br&gt;
Severe:&lt;br&gt;
MATLAB:I18n:MissingICUData - ICU Data not found.&lt;br&gt;
The program '[2760] c:\Documents and &lt;br&gt;
Settings\Administrator\Desktop\simple\PumaClient.exe: Native' has exited &lt;br&gt;
with code 2 (0x2).&lt;br&gt;
&lt;br&gt;
&lt;br&gt;
I have read the &quot;Compiling and Linking MATLAB? Engine Programs&quot; section &lt;br&gt;
of the help. but I'm obviously confused and would really appreciate if you &lt;br&gt;
could walk me on this one...&lt;br&gt;
&lt;br&gt;
Thank you very very much!</description>
    </item>
    <item>
      <pubDate>Wed, 04 Jun 2008 00:03:02 -0400</pubDate>
      <title>Re: Linking C++ and Matlab using VS2003</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/170417#435738</link>
      <author>James Tursa</author>
      <description>&lt;br&gt;
How are you compiling your program? Are you using the mex &lt;br&gt;
command from the MATLAB command line, or are you trying to &lt;br&gt;
do the compile from within the Visual Studio environment? &lt;br&gt;
I usually do the compile using the mex command at the &lt;br&gt;
MATLAB prompt, but this usually means I have to manually &lt;br&gt;
copy any dll files from the C++ or Fortran compiler &lt;br&gt;
directories and then specify them in the mex command to &lt;br&gt;
get the link to work. I haven't tried the other way, as &lt;br&gt;
you seem to be doing.&lt;br&gt;
&lt;br&gt;
James Tursa</description>
    </item>
    <item>
      <pubDate>Wed, 04 Jun 2008 22:14:02 -0400</pubDate>
      <title>Re: Linking C++ and Matlab using VS2003</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/170417#435900</link>
      <author>Daniel Vogel</author>
      <description>&quot;James Tursa&quot; &amp;lt;aclassyguywithaknotac@hotmail.com&amp;gt; wrote in message &lt;br&gt;
&amp;lt;g24m3m$1cv$1@fred.mathworks.com&amp;gt;...&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; How are you compiling your program? Are you using the mex &lt;br&gt;
&amp;gt; command from the MATLAB command line, or are you trying to &lt;br&gt;
&amp;gt; do the compile from within the Visual Studio environment? &lt;br&gt;
&amp;gt; I usually do the compile using the mex command at the &lt;br&gt;
&amp;gt; MATLAB prompt, but this usually means I have to manually &lt;br&gt;
&amp;gt; copy any dll files from the C++ or Fortran compiler &lt;br&gt;
&amp;gt; directories and then specify them in the mex command to &lt;br&gt;
&amp;gt; get the link to work. I haven't tried the other way, as &lt;br&gt;
&amp;gt; you seem to be doing.&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; James Tursa&lt;br&gt;
&amp;gt; &lt;br&gt;
&lt;br&gt;
&lt;br&gt;
I'm trying to compile it directly from VS2003. I solved my problem &lt;br&gt;
downgrading from the latest version of Matlab to 6.5 (which I had lying &lt;br&gt;
around). It now works perfectly only with the linking of the libraries + dll &lt;br&gt;
files.&lt;br&gt;
&lt;br&gt;
&lt;br&gt;
Could this be a bug in Matlab R2008a?</description>
    </item>
    <item>
      <pubDate>Mon, 15 Mar 2010 21:02:06 -0400</pubDate>
      <title>Re: Linking C++ and Matlab using VS2003</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/170417#726618</link>
      <author>Gary Willenbring</author>
      <description>&quot;Daniel Vogel&quot; &amp;lt;vogel@stanford.edu&amp;gt; wrote in message &amp;lt;g2743a$ajq$1@fred.mathworks.com&amp;gt;...&lt;br&gt;
&amp;gt; &quot;James Tursa&quot; &amp;lt;aclassyguywithaknotac@hotmail.com&amp;gt; wrote in message &lt;br&gt;
&amp;gt; &amp;lt;g24m3m$1cv$1@fred.mathworks.com&amp;gt;...&lt;br&gt;
&amp;gt; &amp;gt; &lt;br&gt;
&amp;gt; &amp;gt; How are you compiling your program? Are you using the mex &lt;br&gt;
&amp;gt; &amp;gt; command from the MATLAB command line, or are you trying to &lt;br&gt;
&amp;gt; &amp;gt; do the compile from within the Visual Studio environment? &lt;br&gt;
&amp;gt; &amp;gt; I usually do the compile using the mex command at the &lt;br&gt;
&amp;gt; &amp;gt; MATLAB prompt, but this usually means I have to manually &lt;br&gt;
&amp;gt; &amp;gt; copy any dll files from the C++ or Fortran compiler &lt;br&gt;
&amp;gt; &amp;gt; directories and then specify them in the mex command to &lt;br&gt;
&amp;gt; &amp;gt; get the link to work. I haven't tried the other way, as &lt;br&gt;
&amp;gt; &amp;gt; you seem to be doing.&lt;br&gt;
&amp;gt; &amp;gt; &lt;br&gt;
&amp;gt; &amp;gt; James Tursa&lt;br&gt;
&amp;gt; &amp;gt; &lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; I'm trying to compile it directly from VS2003. I solved my problem &lt;br&gt;
&amp;gt; downgrading from the latest version of Matlab to 6.5 (which I had lying &lt;br&gt;
&amp;gt; around). It now works perfectly only with the linking of the libraries + dll &lt;br&gt;
&amp;gt; files.&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; Could this be a bug in Matlab R2008a?&lt;br&gt;
&lt;br&gt;
---------------------------------------------------&lt;br&gt;
Hi - has a workaround for this issue been identified?  I'm seeing the same thing with example engwindemo on 2009A.  Thanks.  Gary&lt;br&gt;
&lt;br&gt;
&lt;br&gt;
Thanks,  Gary</description>
    </item>
    <item>
      <pubDate>Tue, 06 Apr 2010 01:08:04 -0400</pubDate>
      <title>Re: Linking C++ and Matlab using VS2003</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/170417#733320</link>
      <author>Mike </author>
      <description>&lt;br&gt;
&amp;gt; ---------------------------------------------------&lt;br&gt;
&amp;gt; Hi - has a workaround for this issue been identified?  I'm seeing the same thing with example engwindemo on 2009A.  Thanks.  Gary&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; Thanks,  Gary&lt;br&gt;
&lt;br&gt;
&lt;br&gt;
I was able to compile the sample projects on a computer with the full Matlab environment + the compiler installed.  Now I'm trying to run the resulting executable on a computer with only the matlab compiler runtime installed (because we want to distribute this program to people who don't have matlab).  And I'm getting the same error.  Have not yet found a solution.</description>
    </item>
    <item>
      <pubDate>Thu, 08 Apr 2010 13:00:22 -0400</pubDate>
      <title>Re: Linking C++ and Matlab using VS2003</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/170417#734177</link>
      <author>Dominique </author>
      <description>I am having the same  problem and i really start thinking that there are something seriously wrong with matlab !!!&lt;br&gt;
&lt;br&gt;
&quot;Mike &quot; &amp;lt;schneider@ict.usc.edu&amp;gt; wrote in message &amp;lt;hpe1hk$1sp$1@fred.mathworks.com&amp;gt;...&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; &amp;gt; ---------------------------------------------------&lt;br&gt;
&amp;gt; &amp;gt; Hi - has a workaround for this issue been identified?  I'm seeing the same thing with example engwindemo on 2009A.  Thanks.  Gary&lt;br&gt;
&amp;gt; &amp;gt; &lt;br&gt;
&amp;gt; &amp;gt; &lt;br&gt;
&amp;gt; &amp;gt; Thanks,  Gary&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; I was able to compile the sample projects on a computer with the full Matlab environment + the compiler installed.  Now I'm trying to run the resulting executable on a computer with only the matlab compiler runtime installed (because we want to distribute this program to people who don't have matlab).  And I'm getting the same error.  Have not yet found a solution.</description>
    </item>
    <item>
      <pubDate>Fri, 09 Apr 2010 22:24:04 -0400</pubDate>
      <title>Re: Linking C++ and Matlab using VS2003</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/170417#734772</link>
      <author>Mike </author>
      <description>OK I was able to get it working.  I had to update the PATH to include the location of the (which I had already done) to this: C:\Program Files\MATLAB\MATLAB Compiler Runtime\v711\bin\win32&lt;br&gt;
&lt;br&gt;
That allows the .exe to find the .dll files required by the matlab compiler runtime. &lt;br&gt;
&lt;br&gt;
Then I had to reboot (I think this was the missing step).&lt;br&gt;
&lt;br&gt;
Also the .exe has to be compiled against the same version of the .dll that it is being run with.&lt;br&gt;
&lt;br&gt;
&quot;Dominique &quot; &amp;lt;domdominy@gmail.com&amp;gt; wrote in message &amp;lt;hpkk16$pnk$1@fred.mathworks.com&amp;gt;...&lt;br&gt;
&amp;gt; I am having the same  problem and i really start thinking that there are something seriously wrong with matlab !!!&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; &quot;Mike &quot; &amp;lt;schneider@ict.usc.edu&amp;gt; wrote in message &amp;lt;hpe1hk$1sp$1@fred.mathworks.com&amp;gt;...&lt;br&gt;
&amp;gt; &amp;gt; &lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; ---------------------------------------------------&lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; Hi - has a workaround for this issue been identified?  I'm seeing the same thing with example engwindemo on 2009A.  Thanks.  Gary&lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; &lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; &lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; Thanks,  Gary&lt;br&gt;
&amp;gt; &amp;gt; &lt;br&gt;
&amp;gt; &amp;gt; &lt;br&gt;
&amp;gt; &amp;gt; I was able to compile the sample projects on a computer with the full Matlab environment + the compiler installed.  Now I'm trying to run the resulting executable on a computer with only the matlab compiler runtime installed (because we want to distribute this program to people who don't have matlab).  And I'm getting the same error.  Have not yet found a solution.</description>
    </item>
    <item>
      <pubDate>Tue, 13 Apr 2010 07:09:05 -0400</pubDate>
      <title>Re: Linking C++ and Matlab using VS2003</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/170417#735605</link>
      <author>Aditya </author>
      <description>&quot;Mike &quot; &amp;lt;schneider@ict.usc.edu&amp;gt; wrote in message &amp;lt;hpo9e4$b30$1@fred.mathworks.com&amp;gt;...&lt;br&gt;
&amp;gt; OK I was able to get it working.  I had to update the PATH to include the location of the (which I had already done) to this: C:\Program Files\MATLAB\MATLAB Compiler Runtime\v711\bin\win32&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; That allows the .exe to find the .dll files required by the matlab compiler runtime. &lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; Then I had to reboot (I think this was the missing step).&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; Also the .exe has to be compiled against the same version of the .dll that it is being run with.&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; &quot;Dominique &quot; &amp;lt;domdominy@gmail.com&amp;gt; wrote in message &amp;lt;hpkk16$pnk$1@fred.mathworks.com&amp;gt;...&lt;br&gt;
&amp;gt; &amp;gt; I am having the same  problem and i really start thinking that there are something seriously wrong with matlab !!!&lt;br&gt;
&amp;gt; &amp;gt; &lt;br&gt;
&amp;gt; &amp;gt; &quot;Mike &quot; &amp;lt;schneider@ict.usc.edu&amp;gt; wrote in message &amp;lt;hpe1hk$1sp$1@fred.mathworks.com&amp;gt;...&lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; &lt;br&gt;
&lt;br&gt;
Hi &lt;br&gt;
&lt;br&gt;
Even i am trying to make this demo work. I was able to run the demo in Visual studio 2005 version. But when i do the same steps . The build is complete it says that i am missing a libeng.dll&lt;br&gt;
So &quot;Matlab engine can't open&quot;&lt;br&gt;
I have tried the path to vs-&amp;gt;tools-&amp;gt;options-&amp;gt;projects&amp;solutions-&amp;gt;C++ directories. As i know where the libeng.dll is there in the matlab folder. Also i tried attaching it in the solution explorer. As a existing item. Please help&lt;br&gt;
&lt;br&gt;
thanks in advance&lt;br&gt;
&lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; &amp;gt; ---------------------------------------------------&lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; &amp;gt; Hi - has a workaround for this issue been identified?  I'm seeing the same thing with example engwindemo on 2009A.  Thanks.  Gary&lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; &amp;gt; &lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; &amp;gt; &lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; &amp;gt; Thanks,  Gary&lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; &lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; &lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; I was able to compile the sample projects on a computer with the full Matlab environment + the compiler installed.  Now I'm trying to run the resulting executable on a computer with only the matlab compiler runtime installed (because we want to distribute this program to people who don't have matlab).  And I'm getting the same error.  Have not yet found a solution.</description>
    </item>
    <item>
      <pubDate>Wed, 19 Jan 2011 10:01:06 -0500</pubDate>
      <title>Re: Linking C++ and Matlab using VS2003</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/170417#813613</link>
      <author>Vidi </author>
      <description>Hi there,&lt;br&gt;
&lt;br&gt;
I run engdemo.cpp from matlab R2009b on VS2005, and I got this error:&lt;br&gt;
&quot;engwindemo.exe - system error. The program can't start because libmx.dll is missing from your computer....&quot;&lt;br&gt;
&lt;br&gt;
I can find libmx.dll in the matlab root: C:/Program Files/MATLAB/R2009b/extern/lib/win32/microsoft&lt;br&gt;
I also have created the path to Matlab in the VS2005 &quot;Include files&quot; and &quot;Library files&quot; Directories, and included the appropriate library files in VS2005. Wonder why do I get this message.&lt;br&gt;
&lt;br&gt;
Really appreciate for your help.&lt;br&gt;
&lt;br&gt;
Thank you,&lt;br&gt;
Vidy</description>
    </item>
    <item>
      <pubDate>Tue, 22 Mar 2011 02:47:04 -0400</pubDate>
      <title>Re: Linking C++ and Matlab using VS2003</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/170417#826515</link>
      <author>Victor </author>
      <description>I have the same error!!&lt;br&gt;
I really don't know what to do!&lt;br&gt;
I'm Linking C++ with matlab using VS2008 and matlab 2010a&lt;br&gt;
When i copy the missing .dll's (icudt40.dll and others) to the Visual Studio project&lt;br&gt;
at the run of the aplication i get the exactly same message:&lt;br&gt;
severe:&lt;br&gt;
Matlab.. missing ICUData........&lt;br&gt;
&lt;br&gt;
HELP PLEASE!</description>
    </item>
    <item>
      <pubDate>Fri, 17 Jun 2011 19:05:20 -0400</pubDate>
      <title>Re: Linking C++ and Matlab using VS2003</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/170417#841661</link>
      <author>Seth </author>
      <description>I fixed the missing libmx.dll error for the engwindemo.cpp example program by adding the directory containing libmx.dll (in my case C:\Program Files (x86)\MATLAB\R2009bSP1\bin\win32) to the PATH variable in my system Environment Variables.&lt;br&gt;
&lt;br&gt;
Right click My Computer -&amp;gt; Properties -&amp;gt; Advanced Tab -&amp;gt; Environment Variables -&amp;gt; Edit PATH Variable. Add the directory containing libmx.dll to the end.&lt;br&gt;
&lt;br&gt;
Then close and reopen your visual studio solution, and the program should run.&lt;br&gt;
&lt;br&gt;
&quot;Victor&quot; wrote in message &amp;lt;im92j8$les$1@fred.mathworks.com&amp;gt;...&lt;br&gt;
&amp;gt; I have the same error!!&lt;br&gt;
&amp;gt; I really don't know what to do!&lt;br&gt;
&amp;gt; I'm Linking C++ with matlab using VS2008 and matlab 2010a&lt;br&gt;
&amp;gt; When i copy the missing .dll's (icudt40.dll and others) to the Visual Studio project&lt;br&gt;
&amp;gt; at the run of the aplication i get the exactly same message:&lt;br&gt;
&amp;gt; severe:&lt;br&gt;
&amp;gt; Matlab.. missing ICUData........&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; HELP PLEASE!</description>
    </item>
    <item>
      <pubDate>Fri, 05 Aug 2011 19:39:26 -0400</pubDate>
      <title>Re: Linking C++ and Matlab using VS2003</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/170417#848187</link>
      <author>Timothy </author>
      <description>Seth is correct, once you have compiled your program/demo, the executable looks in the directories listed in the PATH environment variable to locate the necessary DLL's.&lt;br&gt;
&lt;br&gt;
&quot;Seth &quot; &amp;lt;wingmasterx@hotmail.com&amp;gt; wrote in message &amp;lt;itg8hg$ep5$1@newscl01ah.mathworks.com&amp;gt;...&lt;br&gt;
&amp;gt; I fixed the missing libmx.dll error for the engwindemo.cpp example program by adding the directory containing libmx.dll (in my case C:\Program Files (x86)\MATLAB\R2009bSP1\bin\win32) to the PATH variable in my system Environment Variables.&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; Right click My Computer -&amp;gt; Properties -&amp;gt; Advanced Tab -&amp;gt; Environment Variables -&amp;gt; Edit PATH Variable. Add the directory containing libmx.dll to the end.&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; Then close and reopen your visual studio solution, and the program should run.&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; &quot;Victor&quot; wrote in message &amp;lt;im92j8$les$1@fred.mathworks.com&amp;gt;...&lt;br&gt;
&amp;gt; &amp;gt; I have the same error!!&lt;br&gt;
&amp;gt; &amp;gt; I really don't know what to do!&lt;br&gt;
&amp;gt; &amp;gt; I'm Linking C++ with matlab using VS2008 and matlab 2010a&lt;br&gt;
&amp;gt; &amp;gt; When i copy the missing .dll's (icudt40.dll and others) to the Visual Studio project&lt;br&gt;
&amp;gt; &amp;gt; at the run of the aplication i get the exactly same message:&lt;br&gt;
&amp;gt; &amp;gt; severe:&lt;br&gt;
&amp;gt; &amp;gt; Matlab.. missing ICUData........&lt;br&gt;
&amp;gt; &amp;gt; &lt;br&gt;
&amp;gt; &amp;gt; HELP PLEASE!</description>
    </item>
  </channel>
</rss>

