<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0">
  <channel>
    <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/264475</link>
    <title>MATLAB Central Newsreader - Compiling MEX-file with external library</title>
    <description>Feed for thread: Compiling MEX-file with external library</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, 29 Oct 2009 15:36:14 -0400</pubDate>
      <title>Compiling MEX-file with external library</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/264475#690694</link>
      <author>Ralf</author>
      <description>Hello all,&lt;br&gt;
&lt;br&gt;
I am trying to compile a MEX-file, which uses an external library&lt;br&gt;
function. The library is available as &quot;tcdlls.lib&quot;.&lt;br&gt;
&lt;br&gt;
But performing the compilation I get the following error. I have tried&lt;br&gt;
also copying the .lib file to the working directory, but this did not&lt;br&gt;
help. The library-file is correctly spelled. Using Visual Studio or&lt;br&gt;
LCC-compiler did not make any difference. What is going wrong?&lt;br&gt;
&lt;br&gt;
Thank you very much,&lt;br&gt;
Ralf&lt;br&gt;
&lt;br&gt;
&amp;gt;&amp;gt; mex timestwo.c -ltcdlls.lib -L&quot;D:\Eigene Dateien\LibPath\&quot;&lt;br&gt;
&lt;br&gt;
Warning: MEX could not find the library &quot;tcdlls.lib&quot;&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;specified with -l option on the path specified&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;with the -L option.&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;Bibliothek &quot;.......\templib.x&quot; und Objekt &quot;.......\templib.exp&quot;&lt;br&gt;
werden erstellt.&lt;br&gt;
timestwo.obj : error LNK2019: Verweis auf nicht aufgel&#246;stes externes&lt;br&gt;
Symbol (unresolved external symbol) &quot;_tc_init_root&quot; in Funktion&lt;br&gt;
&quot;_timestwo&quot;.&lt;br&gt;
timestwo.mexw32 : fatal error LNK1120: 1 nicht aufgel&#246;ste externe&lt;br&gt;
Verweise (unresolved external symbol).&lt;br&gt;
&lt;br&gt;
&amp;nbsp;&amp;nbsp;C:\PROGRA~1\MATLAB\R2009B\BIN\MEX.PL: Error: Link of&lt;br&gt;
'timestwo.mexw32' failed.&lt;br&gt;
&lt;br&gt;
??? Error using ==&amp;gt; mex at 221&lt;br&gt;
Unable to complete successfully.</description>
    </item>
    <item>
      <pubDate>Thu, 29 Oct 2009 15:51:28 -0400</pubDate>
      <title>Re: Compiling MEX-file with external library</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/264475#690702</link>
      <author>roger</author>
      <description>On Oct 29, 4:36&#160;pm, Ralf &amp;lt;meteora...@gmx.net&amp;gt; wrote:&lt;br&gt;
&amp;gt; Hello all,&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; I am trying to compile a MEX-file, which uses an external library&lt;br&gt;
&amp;gt; function. The library is available as &quot;tcdlls.lib&quot;.&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; But performing the compilation I get the following error. I have tried&lt;br&gt;
&amp;gt; also copying the .lib file to the working directory, but this did not&lt;br&gt;
&amp;gt; help. The library-file is correctly spelled. Using Visual Studio or&lt;br&gt;
&amp;gt; LCC-compiler did not make any difference. What is going wrong?&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; Thank you very much,&lt;br&gt;
&amp;gt; Ralf&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; &amp;gt;&amp;gt; mex timestwo.c -ltcdlls.lib -L&quot;D:\Eigene Dateien\LibPath\&quot;&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; Warning: MEX could not find the library &quot;tcdlls.lib&quot;&lt;br&gt;
&amp;gt; &#160; &#160; &#160; &#160; &#160;specified with -l option on the path specified&lt;br&gt;
&amp;gt; &#160; &#160; &#160; &#160; &#160;with the -L option.&lt;br&gt;
&amp;gt; &#160; &#160;Bibliothek &quot;.......\templib.x&quot; und Objekt &quot;.......\templib.exp&quot;&lt;br&gt;
&amp;gt; werden erstellt.&lt;br&gt;
&amp;gt; timestwo.obj : error LNK2019: Verweis auf nicht aufgel&#246;stes externes&lt;br&gt;
&amp;gt; Symbol (unresolved external symbol) &quot;_tc_init_root&quot; in Funktion&lt;br&gt;
&amp;gt; &quot;_timestwo&quot;.&lt;br&gt;
&amp;gt; timestwo.mexw32 : fatal error LNK1120: 1 nicht aufgel&#246;ste externe&lt;br&gt;
&amp;gt; Verweise (unresolved external symbol).&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; &#160; C:\PROGRA~1\MATLAB\R2009B\BIN\MEX.PL: Error: Link of&lt;br&gt;
&amp;gt; 'timestwo.mexw32' failed.&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; ??? Error using ==&amp;gt; mex at 221&lt;br&gt;
&amp;gt; Unable to complete successfully.&lt;br&gt;
&lt;br&gt;
it is in fact a link error, not a compile error but that's not really&lt;br&gt;
the point.&lt;br&gt;
Where are the templib.x and templib.exp files located? are they on the&lt;br&gt;
right path?&lt;br&gt;
R</description>
    </item>
    <item>
      <pubDate>Thu, 29 Oct 2009 16:49:02 -0400</pubDate>
      <title>Re: Compiling MEX-file with external library</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/264475#690734</link>
      <author>James Tursa</author>
      <description>Ralf &amp;lt;meteoradix@gmx.net&amp;gt; wrote in message &amp;lt;a23855e8-0d6f-4496-b672-014203e218e1@p15g2000vbl.googlegroups.com&amp;gt;...&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; I am trying to compile a MEX-file, which uses an external library&lt;br&gt;
&amp;gt; function. The library is available as &quot;tcdlls.lib&quot;.&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; I have tried&lt;br&gt;
&amp;gt; also copying the .lib file to the working directory, but this did not&lt;br&gt;
&amp;gt; help.&lt;br&gt;
&lt;br&gt;
What mex command did you use when you tried this method? I would expect this to work:&lt;br&gt;
&lt;br&gt;
mex timestwo.c tcdlls.lib&lt;br&gt;
&lt;br&gt;
James Tursa</description>
    </item>
    <item>
      <pubDate>Thu, 29 Oct 2009 17:18:16 -0400</pubDate>
      <title>Re: Compiling MEX-file with external library</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/264475#690751</link>
      <author>Praetorian</author>
      <description>On Oct 29, 10:49&#160;am, &quot;James Tursa&quot;&lt;br&gt;
&amp;lt;aclassyguy_with_a_k_not_...@hotmail.com&amp;gt; wrote:&lt;br&gt;
&amp;gt; Ralf &amp;lt;meteora...@gmx.net&amp;gt; wrote in message &amp;lt;a23855e8-0d6f-4496-b672-014203e21...@p15g2000vbl.googlegroups.com&amp;gt;...&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; &amp;gt; I am trying to compile a MEX-file, which uses an external library&lt;br&gt;
&amp;gt; &amp;gt; function. The library is available as &quot;tcdlls.lib&quot;.&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; &amp;gt; I have tried&lt;br&gt;
&amp;gt; &amp;gt; also copying the .lib file to the working directory, but this did not&lt;br&gt;
&amp;gt; &amp;gt; help.&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; What mex command did you use when you tried this method? I would expect this to work:&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; mex timestwo.c tcdlls.lib&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; James Tursa&lt;br&gt;
&lt;br&gt;
Do as James suggested, do no use the -l or -L directives, just list&lt;br&gt;
the .lib files along with the list of source files. You can either&lt;br&gt;
copy the library to the working directory or enter the path to&lt;br&gt;
wherever it is located.&lt;br&gt;
&lt;br&gt;
HTH,&lt;br&gt;
Ashish.</description>
    </item>
    <item>
      <pubDate>Fri, 30 Oct 2009 07:22:34 -0400</pubDate>
      <title>Re: Compiling MEX-file with external library</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/264475#690890</link>
      <author>Ralf</author>
      <description>On 29 Okt., 18:18, Praetorian &amp;lt;ashish.sadanan...@gmail.com&amp;gt; wrote:&lt;br&gt;
&amp;gt; On Oct 29, 10:49&#160;am, &quot;James Tursa&quot;&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; &amp;lt;aclassyguy_with_a_k_not_...@hotmail.com&amp;gt; wrote:&lt;br&gt;
&amp;gt; &amp;gt; Ralf &amp;lt;meteora...@gmx.net&amp;gt; wrote in message &amp;lt;a23855e8-0d6f-4496-b672-014203e21...@p15g2000vbl.googlegroups.com&amp;gt;...&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; I am trying tocompilea MEX-file, which uses an external library&lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; function. The library is available as &quot;tcdlls.lib&quot;.&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; I have tried&lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; also copying the .lib file to the working directory, but this did not&lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; help.&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; &amp;gt; What mex command did you use when you tried this method? I would expect this to work:&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; &amp;gt; mex timestwo.c tcdlls.lib&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; &amp;gt; James Tursa&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; Do as James suggested, do no use the -l or -L directives, just list&lt;br&gt;
&amp;gt; the .lib files along with the list of source files. You can either&lt;br&gt;
&amp;gt; copy the library to the working directory or enter the path to&lt;br&gt;
&amp;gt; wherever it is located.&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; HTH,&lt;br&gt;
&amp;gt; Ashish.&lt;br&gt;
&lt;br&gt;
Thank you all,&lt;br&gt;
&lt;br&gt;
using the commands&lt;br&gt;
&lt;br&gt;
mex timestwo.c tcdlls.lib&lt;br&gt;
&lt;br&gt;
or&lt;br&gt;
&lt;br&gt;
mex timestwo.c &quot;C:\......\tcdlls.lib&quot;&lt;br&gt;
&lt;br&gt;
works without problems.&lt;br&gt;
&lt;br&gt;
Ralf</description>
    </item>
  </channel>
</rss>

