<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
	<title type="html"><![CDATA[Approximatrix Forums — Order of library search]]></title>
	<link rel="self" href="https://forums.approximatrix.com/extern.php?action=feed&amp;tid=251&amp;type=atom" />
	<updated>2013-09-06T18:33:36Z</updated>
	<generator>PunBB</generator>
	<id>https://forums.approximatrix.com/viewtopic.php?id=251</id>
		<entry>
			<title type="html"><![CDATA[Re: Order of library search]]></title>
			<link rel="alternate" href="https://forums.approximatrix.com/viewtopic.php?pid=977#p977" />
			<content type="html"><![CDATA[<p>That&#039;s weird. There are dependencies for sure, but the order they are supplied shouldn&#039;t make any difference.</p><p>The fact that your sorting them alphabetically before passing them to the linker shows that.</p><p>By the way, I &quot;upgraded&quot; to the 2.x licence <img src="https://forums.approximatrix.com/img/smilies/wink.png" width="15" height="15" alt="wink" /> . I am going to do a lot of work with Simply Fortran over the weekend.</p>]]></content>
			<author>
				<name><![CDATA[davidb]]></name>
				<uri>https://forums.approximatrix.com/profile.php?id=3463</uri>
			</author>
			<updated>2013-09-06T18:33:36Z</updated>
			<id>https://forums.approximatrix.com/viewtopic.php?pid=977#p977</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Order of library search]]></title>
			<link rel="alternate" href="https://forums.approximatrix.com/viewtopic.php?pid=976#p976" />
			<content type="html"><![CDATA[<p>John,</p><p>Welcome to the wonderful world of library dependencies!&nbsp; In your example, the flags have to be listed as:</p><div class="codebox"><pre><code>-ldis -luser32 -lgdi32 -lopengl32</code></pre></div><p> </p><p>because DISLIN relies on Windows&#039; <em>user32</em>, <em>gdi32</em>, and <em>opengl32</em> libraries.&nbsp; So the order just has to be in that order.&nbsp; </p><p>Simply Fortran does not automatically determine library dependencies because it would extremely difficult the way things are set up.&nbsp; GNU/Linux has a way to do it: each library can right a <em>pkgconfig</em> file that explains what other libraries it depends on.</p><p>When libraries are included in the project panel, they are passed to the linker in alphabetical order, but always before the library entries in the Linker Flags under Project Options.</p><p>I&#039;m not sure the manual explicitly outlines how libraries work.&nbsp; It is lacking in this respect.</p>]]></content>
			<author>
				<name><![CDATA[jeff]]></name>
				<uri>https://forums.approximatrix.com/profile.php?id=2</uri>
			</author>
			<updated>2013-09-06T17:49:06Z</updated>
			<id>https://forums.approximatrix.com/viewtopic.php?pid=976#p976</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Order of library search]]></title>
			<link rel="alternate" href="https://forums.approximatrix.com/viewtopic.php?pid=975#p975" />
			<content type="html"><![CDATA[<p>I have noticed that the order in which libraries are listed seems to be critically important.</p><p>I am referring to when this is done by naming &quot;libxxxxxx.a&quot; libraries in the &#039;Linker&#039; field, under Project Options&gt;Project Flags.&nbsp; &nbsp;<br />I have not investigated whether it makes any difference what order they are entered when invoked by the alternative method, of adding the &quot;xxxxxx.a&quot; files (the &quot;lib...&quot; filename prefix being permissible but unnecessary), in the Project Options panel.</p><p>The example I am using, from which I have discovered this, is as follows.</p><p>When I enter the following in the Linker field, the BUILD fails with a long list of not-found subroutines:<br />[ -luser32 -lgdi32 -lopengl32 -liowin -ldis&nbsp; ]</p><p>When I enter the following in the Linker field, the BUILD succeeds:<br />[ -liowin -ldis -luser32 -lgdi32 -lopengl32&nbsp; ]</p><p>I have not checked whether this behaviour is covered by the SF2.1 help files.&nbsp; Someone please tell me to RTFM if necessary!<br />If it is not in the manual, then any guidance on how best to select the library entry sequence would be helpful.&nbsp; Also, Jeff, is this behaviour as intended?</p><p>Could anyone who knows also please also tell us whether it matters in which order we add library &quot;xxxxx.a&quot; files to the project outline, when using this method of having SF2.1 search them.<br />--- <br />John</p>]]></content>
			<author>
				<name><![CDATA[JohnWasilewski]]></name>
				<uri>https://forums.approximatrix.com/profile.php?id=102</uri>
			</author>
			<updated>2013-09-06T17:20:50Z</updated>
			<id>https://forums.approximatrix.com/viewtopic.php?pid=975#p975</id>
		</entry>
</feed>
