<?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 Quote:ianh wrote: in Intel® Fortran Compiler</title>
    <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Link-error-using-makefile/m-p/1104698#M127593</link>
    <description>&lt;P&gt;&lt;/P&gt;&lt;BLOCKQUOTE&gt;ianh wrote:&lt;BR /&gt;&lt;P&gt;&lt;/P&gt;

&lt;P&gt;Your makefile &lt;A href="https://msdn.microsoft.com/en-us/library/99at5bh3.aspx" rel="nofollow"&gt;obliterates&lt;/A&gt; the &lt;A href="https://msdn.microsoft.com/en-us/library/6y6t9esh.aspx" rel="nofollow"&gt;LIB environment variable&lt;/A&gt; that the linker uses for the library search path.&lt;/P&gt;

&lt;P&gt;Rename the `lib` variable in your makefile to something else.&lt;BR /&gt;
	&amp;nbsp;&lt;/P&gt;

&lt;P&gt;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&lt;/P&gt;

&lt;P&gt;Thank you Kevin and Ian. It is now working.&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 05 Dec 2016 22:48:55 GMT</pubDate>
    <dc:creator>John_S_</dc:creator>
    <dc:date>2016-12-05T22:48:55Z</dc:date>
    <item>
      <title>Link error using makefile</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Link-error-using-makefile/m-p/1104695#M127590</link>
      <description>&lt;P&gt;This is a simple test for ifort.&lt;/P&gt;

&lt;P&gt;test.90:&lt;/P&gt;

&lt;P&gt;integer a,b,c&lt;BR /&gt;
	a = 1&lt;BR /&gt;
	b = 2&lt;BR /&gt;
	call sub(a,b,c)&lt;BR /&gt;
	write(*,*)'c=',c&lt;BR /&gt;
	stop&lt;BR /&gt;
	end&lt;/P&gt;

&lt;P&gt;sub.f90:&lt;/P&gt;

&lt;P&gt;subroutine sub(a,b,c)&lt;BR /&gt;
	integer a,b,c&lt;BR /&gt;
	c=a+b&lt;BR /&gt;
	return&lt;BR /&gt;
	end&lt;/P&gt;

&lt;P&gt;The makefile is:&lt;/P&gt;

&lt;P&gt;lib&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; = sub.lib&lt;BR /&gt;
	exe&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; = test.exe&lt;/P&gt;

&lt;P&gt;&lt;BR /&gt;
	$(lib):&lt;BR /&gt;
	&amp;nbsp;&amp;nbsp;&amp;nbsp; ifort /c sub.f90&lt;BR /&gt;
	&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; lib /out:$(lib) sub.obj&lt;/P&gt;

&lt;P&gt;$(exe):&lt;BR /&gt;
	&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ifort test.f90 sub.lib&lt;/P&gt;

&lt;P&gt;clean:&lt;BR /&gt;
	&amp;nbsp;-del *.exe *.obj&lt;/P&gt;

&lt;P&gt;I first make the library with the command&lt;/P&gt;

&lt;P&gt;make sub.lib&lt;/P&gt;

&lt;P&gt;Then I try to make the exe with the command&lt;/P&gt;

&lt;P&gt;make test.exe&lt;/P&gt;

&lt;P&gt;This gives an error on linking - LNK1104: Cannot open file ifconsol.lib.&lt;/P&gt;

&lt;P&gt;However, if I give the command&lt;/P&gt;

&lt;P&gt;ifort test.f90 sub.lib&lt;/P&gt;

&lt;P&gt;at the command prompt, the program is made without error.&lt;/P&gt;

&lt;P&gt;Why is the makefile causing this error?&lt;/P&gt;

&lt;P&gt;Thank you.&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;

&lt;P&gt;&lt;BR /&gt;
	&amp;nbsp;&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 05 Dec 2016 09:03:15 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Link-error-using-makefile/m-p/1104695#M127590</guid>
      <dc:creator>John_S_</dc:creator>
      <dc:date>2016-12-05T09:03:15Z</dc:date>
    </item>
    <item>
      <title>Change all uses of "lib" in</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Link-error-using-makefile/m-p/1104696#M127591</link>
      <description>&lt;P&gt;Change all uses of "lib" in your makefile to some other spelling (e.g. mylib). As is, the name interferes with the LIB environment variable&amp;nbsp;and throws off the linker.&amp;nbsp;Another way to see the interference is to run nmake with the &lt;STRONG&gt;/E&lt;/STRONG&gt; option; however,&amp;nbsp;&lt;STRONG&gt;/E&lt;/STRONG&gt; is not the solution though, renaming 'lib' is.&lt;/P&gt;</description>
      <pubDate>Mon, 05 Dec 2016 18:58:34 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Link-error-using-makefile/m-p/1104696#M127591</guid>
      <dc:creator>Kevin_D_Intel</dc:creator>
      <dc:date>2016-12-05T18:58:34Z</dc:date>
    </item>
    <item>
      <title>Your makefile obliterates the</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Link-error-using-makefile/m-p/1104697#M127592</link>
      <description>&lt;P&gt;Your makefile &lt;A href="https://msdn.microsoft.com/en-us/library/99at5bh3.aspx"&gt;obliterates&lt;/A&gt; the &lt;A href="https://msdn.microsoft.com/en-us/library/6y6t9esh.aspx"&gt;LIB environment variable&lt;/A&gt; that the linker uses for the library search path.&lt;/P&gt;

&lt;P&gt;Rename the `lib` variable in your makefile to something else.&lt;BR /&gt;
	&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 05 Dec 2016 19:07:00 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Link-error-using-makefile/m-p/1104697#M127592</guid>
      <dc:creator>IanH</dc:creator>
      <dc:date>2016-12-05T19:07:00Z</dc:date>
    </item>
    <item>
      <title>Quote:ianh wrote:</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Link-error-using-makefile/m-p/1104698#M127593</link>
      <description>&lt;P&gt;&lt;/P&gt;&lt;BLOCKQUOTE&gt;ianh wrote:&lt;BR /&gt;&lt;P&gt;&lt;/P&gt;

&lt;P&gt;Your makefile &lt;A href="https://msdn.microsoft.com/en-us/library/99at5bh3.aspx" rel="nofollow"&gt;obliterates&lt;/A&gt; the &lt;A href="https://msdn.microsoft.com/en-us/library/6y6t9esh.aspx" rel="nofollow"&gt;LIB environment variable&lt;/A&gt; that the linker uses for the library search path.&lt;/P&gt;

&lt;P&gt;Rename the `lib` variable in your makefile to something else.&lt;BR /&gt;
	&amp;nbsp;&lt;/P&gt;

&lt;P&gt;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&lt;/P&gt;

&lt;P&gt;Thank you Kevin and Ian. It is now working.&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 05 Dec 2016 22:48:55 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Link-error-using-makefile/m-p/1104698#M127593</guid>
      <dc:creator>John_S_</dc:creator>
      <dc:date>2016-12-05T22:48:55Z</dc:date>
    </item>
  </channel>
</rss>

