<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Linking to libtiff in Intel® Fortran Compiler</title>
    <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Linking-to-libtiff/m-p/854732#M67103</link>
    <description>I changed the makefile for libtiff.lib to get icl to use /MT and lib to use /NODEFAULTLIB:"msvcrt". Now I see libcmt in the dumpbin output for libtiff.lib, and my code links and runs successfully.&lt;BR /&gt;&lt;BR /&gt;Thanks for the pointer.&lt;BR /&gt;</description>
    <pubDate>Thu, 29 Jan 2009 22:57:46 GMT</pubDate>
    <dc:creator>gib</dc:creator>
    <dc:date>2009-01-29T22:57:46Z</dc:date>
    <item>
      <title>Linking to libtiff</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Linking-to-libtiff/m-p/854728#M67099</link>
      <description>I'm trying to use Sam Leffler's libtiff library to read/write tiff files from Fortran. I have built the library with icl, and the test programs work. I have also tested calling a C procedure from Fortran. Now I have some test C code (my_write.cpp) which I compile with icl to my_write.obj, and a Fortran program ftest.f90 which calls the C procedure. All seems OK until I try to link these two with libtiff.lib. I've tried it from the command line (in which case the linker complains about multiply defined symbols, and tells me to use /NODEFAULTLIB:MSVCRT, but that gives far more errors), and from within VS, but that gives a lot of "unresolved external symbol" errors. &lt;BR /&gt;&lt;BR /&gt;It would be great if someone has already figured out how to link to libtiff.lib, otherwise I'd appreciate more general advice about linking to a C-created library.&lt;BR /&gt;&lt;BR /&gt;Thanks&lt;BR /&gt;Gib</description>
      <pubDate>Thu, 29 Jan 2009 05:34:46 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Linking-to-libtiff/m-p/854728#M67099</guid>
      <dc:creator>gib</dc:creator>
      <dc:date>2009-01-29T05:34:46Z</dc:date>
    </item>
    <item>
      <title>Re: Linking to libtiff</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Linking-to-libtiff/m-p/854729#M67100</link>
      <description>&lt;DIV style="margin:0px;"&gt;
&lt;DIV id="quote_reply" style="width: 100%; margin-top: 5px;"&gt;
&lt;DIV style="margin-left:2px;margin-right:2px;"&gt;Quoting - &lt;A href="https://community.intel.com/en-us/profile/311276"&gt;gib&lt;/A&gt;&lt;/DIV&gt;
&lt;DIV style="background-color:#E5E5E5; padding:5px;border: 1px; border-style: inset;margin-left:2px;margin-right:2px;"&gt;&lt;EM&gt;I'm trying to use Sam Leffler's libtiff library to read/write tiff files from Fortran. I have built the library with icl, and the test programs work. I have also tested calling a C procedure from Fortran. Now I have some test C code (my_write.cpp) which I compile with icl to my_write.obj, and a Fortran program ftest.f90 which calls the C procedure. All seems OK until I try to link these two with libtiff.lib. I've tried it from the command line (in which case the linker complains about multiply defined symbols, and tells me to use /NODEFAULTLIB:MSVCRT, but that gives far more errors), and from within VS, but that gives a lot of "unresolved external symbol" errors. &lt;BR /&gt;&lt;BR /&gt;It would be great if someone has already figured out how to link to libtiff.lib, otherwise I'd appreciate more general advice about linking to a C-created library.&lt;BR /&gt;&lt;BR /&gt;&lt;/EM&gt;&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;BR /&gt;What does &lt;BR /&gt;&lt;BR /&gt;/dumpbin:directives libtiff.lib&lt;BR /&gt;&lt;BR /&gt;(ran from Ifort command prompt) say about defaultlibs?&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Thu, 29 Jan 2009 09:19:39 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Linking-to-libtiff/m-p/854729#M67100</guid>
      <dc:creator>Jugoslav_Dujic</dc:creator>
      <dc:date>2009-01-29T09:19:39Z</dc:date>
    </item>
    <item>
      <title>Re: Linking to libtiff</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Linking-to-libtiff/m-p/854730#M67101</link>
      <description>&lt;DIV style="margin:0px;"&gt;
&lt;DIV id="quote_reply" style="width: 100%; margin-top: 5px;"&gt;
&lt;DIV style="margin-left:2px;margin-right:2px;"&gt;Quoting - &lt;A href="https://community.intel.com/en-us/profile/391180"&gt;Jugoslav Dujic&lt;/A&gt;&lt;/DIV&gt;
&lt;DIV style="background-color:#E5E5E5; padding:5px;border: 1px; border-style: inset;margin-left:2px;margin-right:2px;"&gt;&lt;EM&gt;
&lt;DIV style="margin:0px;"&gt;&lt;/DIV&gt;
&lt;BR /&gt;What does &lt;BR /&gt;&lt;BR /&gt;/dumpbin:directives libtiff.lib&lt;BR /&gt;&lt;BR /&gt;(ran from Ifort command prompt) say about defaultlibs?&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/EM&gt;&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
I'm not familiar with dumpbin. The command you gave doesn't seem to work, but this one does:&lt;BR /&gt;dumpbin /directives libtiff.lib&lt;BR /&gt;and gives a great deal of info, most of it repeating the same thing many times. I've attached the output. Does this help?&lt;BR /&gt;&lt;BR /&gt;Should I be trying to build my program at the command line or in VS?&lt;BR /&gt;Would it be easier to combine libtiff.lib and my_write.c as a DLL?&lt;BR /&gt;</description>
      <pubDate>Thu, 29 Jan 2009 18:47:22 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Linking-to-libtiff/m-p/854730#M67101</guid>
      <dc:creator>gib</dc:creator>
      <dc:date>2009-01-29T18:47:22Z</dc:date>
    </item>
    <item>
      <title>Re: Linking to libtiff</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Linking-to-libtiff/m-p/854731#M67102</link>
      <description>&lt;DIV style="margin:0px;"&gt;
&lt;DIV id="quote_reply" style="width: 100%; margin-top: 5px;"&gt;
&lt;DIV style="margin-left:2px;margin-right:2px;"&gt;Quoting - &lt;A href="https://community.intel.com/en-us/profile/391180"&gt;Jugoslav Dujic&lt;/A&gt;&lt;/DIV&gt;
&lt;DIV style="background-color:#E5E5E5; padding:5px;border: 1px; border-style: inset;margin-left:2px;margin-right:2px;"&gt;&lt;EM&gt; &lt;BR /&gt;What does &lt;BR /&gt;&lt;BR /&gt;/dumpbin:directives libtiff.lib&lt;BR /&gt;&lt;BR /&gt;(ran from Ifort command prompt) say about defaultlibs?&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/EM&gt;&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
I am linking like this:&lt;BR /&gt;link ftest.obj my_write.obj libtiff.lib&lt;BR /&gt;&lt;BR /&gt;Since libtiff uses -defaultlib:"MSVCRT" I thought I should look at the other object files:&lt;BR /&gt;&lt;BR /&gt;Dump of file ftest.obj&lt;BR /&gt;&lt;BR /&gt;File Type: COFF OBJECT&lt;BR /&gt;&lt;BR /&gt; Linker Directives&lt;BR /&gt; -----------------&lt;BR /&gt; -defaultlib:"ifconsol"&lt;BR /&gt; -defaultlib:"libifcoremt"&lt;BR /&gt; -defaultlib:"libifport"&lt;BR /&gt; -defaultlib:"libmmt"&lt;BR /&gt; -defaultlib:"LIBCMT"&lt;BR /&gt; -defaultlib:"libirc"&lt;BR /&gt; -defaultlib:"svml_disp"&lt;BR /&gt; -defaultlib:"OLDNAMES"&lt;BR /&gt; -defaultlib:"ifconsol"&lt;BR /&gt; -defaultlib:"libifcoremt"&lt;BR /&gt; -defaultlib:"libifport"&lt;BR /&gt; -defaultlib:"libmmt"&lt;BR /&gt; -defaultlib:"LIBCMT"&lt;BR /&gt; -defaultlib:"libirc"&lt;BR /&gt; -defaultlib:"svml_disp"&lt;BR /&gt; -defaultlib:"OLDNAMES"&lt;BR /&gt;&lt;BR /&gt;Dump of file my_write.obj&lt;BR /&gt;&lt;BR /&gt;File Type: COFF OBJECT&lt;BR /&gt;&lt;BR /&gt; Linker Directives&lt;BR /&gt; -----------------&lt;BR /&gt; -defaultlib:"libmmt"&lt;BR /&gt; -defaultlib:"LIBCMT"&lt;BR /&gt; -defaultlib:"libirc"&lt;BR /&gt; -defaultlib:"svml_disp"&lt;BR /&gt; -defaultlib:"OLDNAMES"&lt;BR /&gt; -defaultlib:"libmmt"&lt;BR /&gt; -defaultlib:"LIBCMT"&lt;BR /&gt; -defaultlib:"libirc"&lt;BR /&gt; -defaultlib:"svml_disp"&lt;BR /&gt; -defaultlib:"OLDNAMES"&lt;BR /&gt;&lt;BR /&gt;It seems that while libtiff.lib uses msvcrt, the other object files both use libcmt. I'm guessing that I need to compile libtiff.lib so that it uses libcmt. Is this correct? I wonder how I can do that ...&lt;BR /&gt;</description>
      <pubDate>Thu, 29 Jan 2009 22:08:01 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Linking-to-libtiff/m-p/854731#M67102</guid>
      <dc:creator>gib</dc:creator>
      <dc:date>2009-01-29T22:08:01Z</dc:date>
    </item>
    <item>
      <title>Re: Linking to libtiff</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Linking-to-libtiff/m-p/854732#M67103</link>
      <description>I changed the makefile for libtiff.lib to get icl to use /MT and lib to use /NODEFAULTLIB:"msvcrt". Now I see libcmt in the dumpbin output for libtiff.lib, and my code links and runs successfully.&lt;BR /&gt;&lt;BR /&gt;Thanks for the pointer.&lt;BR /&gt;</description>
      <pubDate>Thu, 29 Jan 2009 22:57:46 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Linking-to-libtiff/m-p/854732#M67103</guid>
      <dc:creator>gib</dc:creator>
      <dc:date>2009-01-29T22:57:46Z</dc:date>
    </item>
    <item>
      <title>Re: Linking to libtiff</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Linking-to-libtiff/m-p/854733#M67104</link>
      <description>&lt;DIV style="margin:0px;"&gt;
&lt;DIV id="quote_reply" style="width: 100%; margin-top: 5px;"&gt;
&lt;DIV style="margin-left:2px;margin-right:2px;"&gt;Quoting - &lt;A href="https://community.intel.com/en-us/profile/311276"&gt;gib&lt;/A&gt;&lt;/DIV&gt;
&lt;DIV style="background-color:#E5E5E5; padding:5px;border: 1px; border-style: inset;margin-left:2px;margin-right:2px;"&gt;&lt;EM&gt;I changed the makefile for libtiff.lib to get icl to use /MT and lib to use /NODEFAULTLIB:"msvcrt". Now I see libcmt in the dumpbin output for libtiff.lib, and my code links and runs successfully.&lt;BR /&gt;&lt;BR /&gt;Thanks for the pointer.&lt;BR /&gt;&lt;/EM&gt;&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;BR /&gt;You're welcome -- y'know, different time zones :-).&lt;BR /&gt;&lt;BR /&gt;You found one solution to the problem, i.e. build the lib and exe with same C run-time library. I'd rather try building the library with &lt;A href="http://msdn.microsoft.com/en-us/library/f1tbxcxh.aspx"&gt;/Zl (Omit Default Library Name)&lt;/A&gt; -- not to save space, but to strip those nasty references to libm*.lib from the library. Tentatively, in this way you should be able to build the library with any RTL setting of the exe (although MSVC++ has some ugly features which might prevent that).&lt;BR /&gt;</description>
      <pubDate>Fri, 30 Jan 2009 08:27:58 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Linking-to-libtiff/m-p/854733#M67104</guid>
      <dc:creator>Jugoslav_Dujic</dc:creator>
      <dc:date>2009-01-30T08:27:58Z</dc:date>
    </item>
  </channel>
</rss>

