<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
	<title type="html"><![CDATA[Approximatrix Forums — problem linking static labraries]]></title>
	<link rel="self" href="https://forums.approximatrix.com/extern.php?action=feed&amp;tid=591&amp;type=atom" />
	<updated>2016-10-28T14:40:17Z</updated>
	<generator>PunBB</generator>
	<id>https://forums.approximatrix.com/viewtopic.php?id=591</id>
		<entry>
			<title type="html"><![CDATA[Re: problem linking static labraries]]></title>
			<link rel="alternate" href="https://forums.approximatrix.com/viewtopic.php?pid=2689#p2689" />
			<content type="html"><![CDATA[<p>thanks Jeff,<br />Problem with library names is solved!<br />The 2nd question regarding rebuilding after changed lib source is nasty but still to do in this way. In general one should test a Library prior to linking to a main program but in my case it is not so easy (see the CVF history) and needs more effort than test it by the main program.<br />Klaus</p>]]></content>
			<author>
				<name><![CDATA[Klaus Asmus]]></name>
				<uri>https://forums.approximatrix.com/profile.php?id=3617</uri>
			</author>
			<updated>2016-10-28T14:40:17Z</updated>
			<id>https://forums.approximatrix.com/viewtopic.php?pid=2689#p2689</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: problem linking static labraries]]></title>
			<link rel="alternate" href="https://forums.approximatrix.com/viewtopic.php?pid=2688#p2688" />
			<content type="html"><![CDATA[<p>Klaus,</p><p>Using the <em>-l</em> flag normally means the library name following the flag is prefixed with &quot;lib&quot; during the file search.&nbsp; In your example, the linker would be looking for files named <em>libLib_panels.a</em> and <em>liblib_CastorWeight.a</em>.&nbsp; I would strongly recommend that you name those libraries simply <em>libpanels.a</em> and <em>libCastorWeight.a</em> just to conform to what the linker expects, and change the flags to <em>-lpanels -lCastorWeight</em>.&nbsp; I think the linker should work after that change, but perhaps I&#039;m incorrect.</p><p>Simply Fortran doesn&#039;t consider the time stamps of libraries referenced by the <em>-l</em> flag when determining whether or not to rebuild the executable.&nbsp; You need to Clean and Build each time because it doesn&#039;t know that the libraries changed.&nbsp; If the libraries were directly added to the project rather than referenced via flags, which is <strong>not</strong> recommended, it would actually rebuild just the executable properly (but other issues would be introduced).</p><p>You can instead just delete the executable in Windows Explorer instead.&nbsp; If you first do that and then request a build in your main executable project, it will simply re-link using the updated libraries.&nbsp; It isn&#039;t ideal, but it might be significantly faster depending on the complexity of your main executable project.</p><p>I think that Simply Fortran could, in fact, check for time stamps on referenced libraries, although it might be tricky to implement.&nbsp; I&#039;ll have to look into it.</p><p>Let us all know if changing the library names work for your linking issue.</p>]]></content>
			<author>
				<name><![CDATA[jeff]]></name>
				<uri>https://forums.approximatrix.com/profile.php?id=2</uri>
			</author>
			<updated>2016-10-28T11:40:27Z</updated>
			<id>https://forums.approximatrix.com/viewtopic.php?pid=2688#p2688</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[problem linking static labraries]]></title>
			<link rel="alternate" href="https://forums.approximatrix.com/viewtopic.php?pid=2687#p2687" />
			<content type="html"><![CDATA[<p>Problem linking static libraries</p><p>Adding two new libraries to my project following messages appears after build: </p><p>Generating CASTOR12lt.exe<br />c:/program files (x86)/simply fortran 2/mingw-w64/bin/../lib/gcc/x86_64-w64-mingw32/6.1.0/../../../../x86_64-w64-mingw32/bin/ld.exe: cannot find -lLib_panels</p><p>c:/program files (x86)/simply fortran 2/mingw-w64/bin/../lib/gcc/x86_64-w64-mingw32/6.1.0/../../../../x86_64-w64-mingw32/bin/ld.exe: cannot find -llib_CastorWeight<br />collect2.exe: error: ld returned 1 exit status</p><p>Error(E42): Last command making (CASTOR12lt.exe) returned a bad status<br />Error(E02): Make execution terminated</p><p>However Lib_panels.a and lib_CastorWeight.a are properly built in there own directories and the directories are in the search directories of the option tab file locations available under Library Directories like all other lib&#039;s.</p><p>The linker in the compiler flag tab is as follows:<br />-lASC12 -lstructure_concept -ledit-sheet-library -lDXF_interface -llongit_str_check -lLib_panels -llib_CastorWeight</p><p>All prior lib&#039;s are linked properly; thy are all static 64 bits </p><p>What is going wrong and how can I fix this problem?</p><p>An other question: <br />I found that i have to rebuild the main program (compiling all source files of the main program again) after source of libraries are changed. Is there&nbsp; a way to avoid this?</p>]]></content>
			<author>
				<name><![CDATA[Klaus Asmus]]></name>
				<uri>https://forums.approximatrix.com/profile.php?id=3617</uri>
			</author>
			<updated>2016-10-28T10:26:41Z</updated>
			<id>https://forums.approximatrix.com/viewtopic.php?pid=2687#p2687</id>
		</entry>
</feed>
