<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
	<title type="html"><![CDATA[Approximatrix Forums — Static Library Linking Problems]]></title>
	<link rel="self" href="http://forums.approximatrix.com/extern.php?action=feed&amp;tid=584&amp;type=atom" />
	<updated>2016-09-16T14:06:41Z</updated>
	<generator>PunBB</generator>
	<id>http://forums.approximatrix.com/viewtopic.php?id=584</id>
		<entry>
			<title type="html"><![CDATA[Re: Static Library Linking Problems]]></title>
			<link rel="alternate" href="http://forums.approximatrix.com/viewtopic.php?pid=2652#p2652" />
			<content type="html"><![CDATA[<p>Jeff,</p><p>Thanks very much for the reply, this is very helpful.</p><p>Tony</p>]]></content>
			<author>
				<name><![CDATA[tonypdean]]></name>
				<uri>http://forums.approximatrix.com/profile.php?id=3683</uri>
			</author>
			<updated>2016-09-16T14:06:41Z</updated>
			<id>http://forums.approximatrix.com/viewtopic.php?pid=2652#p2652</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Static Library Linking Problems]]></title>
			<link rel="alternate" href="http://forums.approximatrix.com/viewtopic.php?pid=2650#p2650" />
			<content type="html"><![CDATA[<p>Tony,</p><p>Building a static library in Simply Fortran does not actually import in all the necessary Fortran runtime library routines to your static library.&nbsp; You would also need to link against </p><div class="codebox"><pre><code>C:\Program Files (x86)\Simply Fortran 2\mingw-w64\mingw\lib64\libgfortran.a</code></pre></div><p> to get all the necessary runtime library routines into your MS Visual C++ project.&nbsp; However, it isn&#039;t as simple as that.&nbsp; You&#039;ll also need the static GCC library that provides some additional runtime routines.&nbsp; It will get messy very quickly if it even works at all.</p><p>What I would instead suggest is that you build a Fortran dynamic link library and enable the <a href="http://simplyfortran.com/docs/full/options/project.html">&quot;All Static&quot; option under the Linker tab</a> in the Project Options window.&nbsp; That option will ensure a DLL is built that incorporates all necessary runtime routines.&nbsp; You can then link your MS Visual C++ project agains the DLL, and you&#039;ll only need a single DLL (the one you just built) to be distributed with your application (as well as any other dependencies that MS Visual C++ might introduce, of course).</p>]]></content>
			<author>
				<name><![CDATA[jeff]]></name>
				<uri>http://forums.approximatrix.com/profile.php?id=2</uri>
			</author>
			<updated>2016-09-14T12:23:06Z</updated>
			<id>http://forums.approximatrix.com/viewtopic.php?pid=2650#p2650</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Static Library Linking Problems]]></title>
			<link rel="alternate" href="http://forums.approximatrix.com/viewtopic.php?pid=2649#p2649" />
			<content type="html"><![CDATA[<p>Hi,</p><p>I have built a static fortran library which I am linking with a Microsoft Visual C++ program. The library compiles OK but when I link it with the C++ program there are a number of unresolved externals such as __gfortran_transfer_character_write and __gfortran_st_write_done. There are no problem resolving my functions in the library.</p><p>Are there other libraries that I need to link with the C++ program or is there a way to embed these in the fortran library. I have used the -static flag when building the fortran library but this makes no difference.</p><p>This also makes me wonder - Will I need to supply redistributables with my application?</p><p>Any help would be appreciated.</p><p>Tony</p>]]></content>
			<author>
				<name><![CDATA[tonypdean]]></name>
				<uri>http://forums.approximatrix.com/profile.php?id=3683</uri>
			</author>
			<updated>2016-09-14T07:18:58Z</updated>
			<id>http://forums.approximatrix.com/viewtopic.php?pid=2649#p2649</id>
		</entry>
</feed>
