<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
		<title><![CDATA[Approximatrix Forums — Linking program with several static lib's and modules]]></title>
		<link>https://forums.approximatrix.com/viewtopic.php?id=520</link>
		<atom:link href="https://forums.approximatrix.com/extern.php?action=feed&amp;tid=520&amp;type=rss" rel="self" type="application/rss+xml" />
		<description><![CDATA[The most recent posts in Linking program with several static lib's and modules.]]></description>
		<lastBuildDate>Wed, 03 Feb 2016 22:23:33 +0000</lastBuildDate>
		<generator>PunBB</generator>
		<item>
			<title><![CDATA[Re: Linking program with several static lib's and modules]]></title>
			<link>https://forums.approximatrix.com/viewtopic.php?pid=2345#p2345</link>
			<description><![CDATA[<p>Thanks Jeff,<br />Linking is ok <br />Klaus</p>]]></description>
			<author><![CDATA[null@example.com (Klaus Asmus)]]></author>
			<pubDate>Wed, 03 Feb 2016 22:23:33 +0000</pubDate>
			<guid>https://forums.approximatrix.com/viewtopic.php?pid=2345#p2345</guid>
		</item>
		<item>
			<title><![CDATA[Re: Linking program with several static lib's and modules]]></title>
			<link>https://forums.approximatrix.com/viewtopic.php?pid=2341#p2341</link>
			<description><![CDATA[<p>Klaus,</p><p>I&#039;ll assume you&#039;re linking the libraries by including them in the Project Outline.&nbsp; Is that correct?&nbsp; The problem you&#039;re experiencing is because (unfortunately) the libraries must be linked in a certain order.&nbsp; &nbsp;The most &quot;correct&quot; way of fixing your situation is:</p><p>1.&nbsp; Rename your libraries to fit what our compiler expects with a &quot;lib&quot; prefix: <em>libASC12.a</em> and <em>libstructure_concept.a</em> for example.</p><p>2.&nbsp; In <a href="https://simplyfortran.com/docs/full/options/project.html">Project Options</a>, proceed to the <em>File Locations</em> tab, click the <em>Search Directories</em> tab, and ensure that the directory/directories where your library files with the new names exist are listed in the box.</p><p>3.&nbsp; Again, in <a href="https://simplyfortran.com/docs/full/options/project.html">Project Options</a>, proceed to the <em>Compiler Flags</em> tab and add the following flags (based on the names I suggested):</p><div class="codebox"><pre><code>-lASC12 -lstructure_concept</code></pre></div><p>Now your libraries should be linked explicitly in the correct order.&nbsp; You&#039;ll also need to make sure the libraries <strong>are not</strong> explicitly included in the Project Outline.&nbsp; The compiler flags are sufficient to link them properly.</p><p>It&#039;s not the simplest process, but&nbsp; it is the most reliable.</p>]]></description>
			<author><![CDATA[null@example.com (jeff)]]></author>
			<pubDate>Mon, 01 Feb 2016 15:58:47 +0000</pubDate>
			<guid>https://forums.approximatrix.com/viewtopic.php?pid=2341#p2341</guid>
		</item>
		<item>
			<title><![CDATA[Linking program with several static lib's and modules]]></title>
			<link>https://forums.approximatrix.com/viewtopic.php?pid=2339#p2339</link>
			<description><![CDATA[<p>Problem while building main program and linking several libraries</p><p>The project of the program under consideration contains three libraries. All used modules are copied&nbsp; to the sub-directory of the main program. Following happens while building the main program:</p><p>One library, named “structure_concept.a”, gives no trouble</p><p>A second lib, named “ASC12lib.a” contains a&nbsp; procedure which is also used in <br />“structure_concept.a” but where not recognized. Preliminary I fixed that problem by adding the procedure to a file contained in&nbsp; “structure_concept.a”</p><p>A procedure of a third lib, named “edit-sheet-library.a”, is also called&nbsp; from “structure_concept.a”. Building of the main program failed by some error messages “undefined reference to …..”&nbsp; as follows:<br />=======================================================================<br />Generating Makefile... Okay<br />=======================================================================<br />Generating CASTOR12lt.exe<br />E:\ASC_prog_files\CASTOR12\StructureConcept\structure_concept.a(dim_edit_sheet.o): In function `dim_edit_sheet_&#039;:<br />E:\ASC_prog_files\CASTOR12\StructureConcept/./dim_edit_sheet.f90:62: undefined reference to `edit_sheet_&#039;<br />E:\ASC_prog_files\CASTOR12\StructureConcept\structure_concept.a(dim_edit_sheet.o):dim_edit_sheet.f90:(.rdata$.refptr.__edit_sheet_ctr_MOD_exitcode[.refptr.__edit_sheet_ctr_MOD_exitcode]+0x0): undefined reference to `__edit_sheet_ctr_MOD_exitcode&#039;</p><p>…..........</p><p>collect2.exe: error: ld returned 1 exit status<br />Error(E42): Last command making (CASTOR12lt.exe) returned a bad status <br />Error(E02): Make execution terminated<br />Failed *</p><p>Libraries are only added to the main program, because I suppose linking of all is done while building the main program. All libraries are static. What means “shared” in the option window of the lib&#039;s? <br />All projects are using 64 Bit architecture <br />In the file option of the main program no reference is made to the libraries and other modules outside the project of the main program.<br />I also tried to define in &quot;Option, file location, modules&quot; to refer to the original modules of&nbsp; the edit sheet lib<br />but got no other other result</p><p>Please can you give me a hint about linking an project options?</p><p>Best Regards Klaus</p>]]></description>
			<author><![CDATA[null@example.com (Klaus Asmus)]]></author>
			<pubDate>Mon, 01 Feb 2016 11:01:53 +0000</pubDate>
			<guid>https://forums.approximatrix.com/viewtopic.php?pid=2339#p2339</guid>
		</item>
	</channel>
</rss>
