<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
	<title type="html"><![CDATA[Approximatrix Forums — Linking program with several static lib's and modules]]></title>
	<link rel="self" href="https://forums.approximatrix.com/extern.php?action=feed&amp;tid=520&amp;type=atom" />
	<updated>2016-02-03T22:23:33Z</updated>
	<generator>PunBB</generator>
	<id>https://forums.approximatrix.com/viewtopic.php?id=520</id>
		<entry>
			<title type="html"><![CDATA[Re: Linking program with several static lib's and modules]]></title>
			<link rel="alternate" href="https://forums.approximatrix.com/viewtopic.php?pid=2345#p2345" />
			<content type="html"><![CDATA[<p>Thanks Jeff,<br />Linking is ok <br />Klaus</p>]]></content>
			<author>
				<name><![CDATA[Klaus Asmus]]></name>
				<uri>https://forums.approximatrix.com/profile.php?id=3617</uri>
			</author>
			<updated>2016-02-03T22:23:33Z</updated>
			<id>https://forums.approximatrix.com/viewtopic.php?pid=2345#p2345</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Linking program with several static lib's and modules]]></title>
			<link rel="alternate" href="https://forums.approximatrix.com/viewtopic.php?pid=2341#p2341" />
			<content type="html"><![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>]]></content>
			<author>
				<name><![CDATA[jeff]]></name>
				<uri>https://forums.approximatrix.com/profile.php?id=2</uri>
			</author>
			<updated>2016-02-01T15:58:47Z</updated>
			<id>https://forums.approximatrix.com/viewtopic.php?pid=2341#p2341</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Linking program with several static lib's and modules]]></title>
			<link rel="alternate" href="https://forums.approximatrix.com/viewtopic.php?pid=2339#p2339" />
			<content type="html"><![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>]]></content>
			<author>
				<name><![CDATA[Klaus Asmus]]></name>
				<uri>https://forums.approximatrix.com/profile.php?id=3617</uri>
			</author>
			<updated>2016-02-01T11:01:53Z</updated>
			<id>https://forums.approximatrix.com/viewtopic.php?pid=2339#p2339</id>
		</entry>
</feed>
