<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
	<title type="html"><![CDATA[Approximatrix Forums — Can't open module file: No such file or directory]]></title>
	<link rel="self" href="https://forums.approximatrix.com/extern.php?action=feed&amp;tid=710&amp;type=atom" />
	<updated>2019-02-08T15:09:50Z</updated>
	<generator>PunBB</generator>
	<id>https://forums.approximatrix.com/viewtopic.php?id=710</id>
		<entry>
			<title type="html"><![CDATA[Re: Can't open module file: No such file or directory]]></title>
			<link rel="alternate" href="https://forums.approximatrix.com/viewtopic.php?pid=3292#p3292" />
			<content type="html"><![CDATA[<p>I can&#039;t seem to replicate your issue.&nbsp; My &quot;Project B&quot; is picking up the <em>modA</em> module correctly. </p><p>Could you first confirm that <strong>modA.mod</strong> exists in &quot;Project A&#039;s&quot; module directory using Windows Explorer?</p><p>If it does seem to be there, could you email the project files (ending in .prj) to support@approximatrix.com?</p>]]></content>
			<author>
				<name><![CDATA[jeff]]></name>
				<uri>https://forums.approximatrix.com/profile.php?id=2</uri>
			</author>
			<updated>2019-02-08T15:09:50Z</updated>
			<id>https://forums.approximatrix.com/viewtopic.php?pid=3292#p3292</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Can't open module file: No such file or directory]]></title>
			<link rel="alternate" href="https://forums.approximatrix.com/viewtopic.php?pid=3290#p3290" />
			<content type="html"><![CDATA[<p>Alright, will do! I made a pair of test projects just to demonstrate the issue. So I can post the source code of those projects if it would help.</p><br /><p>Project A</p><p>-&gt; Main Program<br /></p><div class="codebox"><pre><code>program mainA

use modA

implicit none
character (5) :: words
character (5) :: modout

words = &#039;help&#039;
call foo(words, modout)
write(*,&#039;(3a)&#039;) words,&#039; = &#039;,modout

words = &#039;why&#039;
call foo(words, modout)
write(*,&#039;(3a)&#039;) words,&#039; = &#039;,modout

words = modout
call foo(words, modout)
write(*,&#039;(3a)&#039;) words,&#039; = &#039;,modout

words = &#039;this&#039;
call foo(words, modout)
write(*,&#039;(3a)&#039;) words,&#039; = &#039;,modout

end program</code></pre></div><p>-&gt;ModA<br /></p><div class="codebox"><pre><code>module modA
implicit none
private
public :: foo

contains

subroutine foo(query, bar)
    character (5), intent (in) :: query
    character (5), intent (out):: bar
    
    select case (query)
        case (&#039;help&#039;) 
            bar = &#039;no&#039;
        case (&#039;why&#039;)
            bar = &#039;who&#039;
        case (&#039;who&#039;)
            bar = &#039;why&#039;
        case default
            bar = &#039;wuut?&#039;
    end select
end subroutine foo

end module modA</code></pre></div><p>ProjectB</p><p>-&gt; Main Program<br /></p><div class="codebox"><pre><code>program mainB

use modA

implicit none
character (5) :: words
character (5) :: modout

words = &#039;test&#039;
call foo(words, modout)
write(*,&#039;(3a)&#039;) words,&#039; = &#039;,modout

end program</code></pre></div>]]></content>
			<author>
				<name><![CDATA[jthomas]]></name>
				<uri>https://forums.approximatrix.com/profile.php?id=3808</uri>
			</author>
			<updated>2019-02-06T14:03:06Z</updated>
			<id>https://forums.approximatrix.com/viewtopic.php?pid=3290#p3290</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Can't open module file: No such file or directory]]></title>
			<link rel="alternate" href="https://forums.approximatrix.com/viewtopic.php?pid=3289#p3289" />
			<content type="html"><![CDATA[<p>I think you&#039;re using it as expected.&nbsp; I&#039;ll have to see if I can replicate the issue on my end.&nbsp; Could you let me know what version of Simply Fortran you&#039;re using and what operating system you&#039;re on?&nbsp; </p><p>After adding a search directory properly, it should be able to pick up modules from it.&nbsp; I&#039;m not sure why you&#039;re having the issue.</p><p>You could also try emailing the project files (just the .prj file, not any source code) and the makefiles for both projects to support@approximatrix.com.&nbsp; I can have a look to see what&#039;s occurring.</p>]]></content>
			<author>
				<name><![CDATA[jeff]]></name>
				<uri>https://forums.approximatrix.com/profile.php?id=2</uri>
			</author>
			<updated>2019-02-06T01:38:35Z</updated>
			<id>https://forums.approximatrix.com/viewtopic.php?pid=3289#p3289</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Can't open module file: No such file or directory]]></title>
			<link rel="alternate" href="https://forums.approximatrix.com/viewtopic.php?pid=3287#p3287" />
			<content type="html"><![CDATA[<p>Hello Everybody,</p><p>This is almost certainly an &quot;inexperienced user&quot; problem, and the solution is probably very obvious, just not to me.</p><p>So, I&#039;ve created a module, compiled and tested said module (let&#039;s call it modA) in a project (let&#039;s call it projA). I&#039;m now working on another project (projB) in which I want to USE the module file. I have added the &quot;module&quot; and &quot;build&quot; directories of projA to the &quot;Include/Module Directories&quot; of projB (via Project Options &gt; File Locations &gt; Search Directories... &gt; Add...). Every time I go to build projB, I get a</p><p>Fatal Error: Can&#039;t open module file &#039;modA.mod&#039; for reading at (1): No such file or directory<br />compilation terminated.</p><br /><p>The result is the same if I:</p><p>1) Try to copy modA.mod to projB&#039;s &quot;Modules&quot; directory</p><p>2) Add modA.mod to the project (from it&#039;s original directory or projB&#039;s &quot;Modules&quot; folder)</p><p>3) Add modA.o to the project from its original directory</p><p>4) Add modA source to the project from its original directory</p><p>The code <strong>DOES</strong> compile if:</p><p>1) I copy modA&#039;s source code to projB&#039;s directory and add it to the project</p><p>2) I copy modA.mod to projB &quot;Modules&quot; dir, copy modA.o to projB &quot;Build&quot; dir, and add modA.o to projB</p><br /><p>Is this the intended way to use modules? I had thought that modules could be compiled, and than just referenced in situ in new projects.</p>]]></content>
			<author>
				<name><![CDATA[jthomas]]></name>
				<uri>https://forums.approximatrix.com/profile.php?id=3808</uri>
			</author>
			<updated>2019-02-05T19:05:06Z</updated>
			<id>https://forums.approximatrix.com/viewtopic.php?pid=3287#p3287</id>
		</entry>
</feed>
