# Cygwin directory structure

**URL:** https://fortran-lang.discourse.group/t/cygwin-directory-structure/3346
**Category:** Help
**Created:** [April 29, 2022, 1:12am UTC](https://fortran-lang.discourse.group/t/cygwin-directory-structure/3346 "2022-04-29T01:12:46Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![martiny1](https://avatars.discourse-cdn.com/v4/letter/m/bc8723/32.png) [@martiny1](https://fortran-lang.discourse.group/u/martiny1)
#### Post date: [April 29, 2022, 1:12am UTC](https://fortran-lang.discourse.group/t/cygwin-directory-structure/3346/1 "2022-04-29T01:12:46Z")

</div>

Hi Fortran experts,

Martin again, sorry for another question.

I am playing around with the source code of Introduction to Computational Economics Using Fortran.

in my previous post, with your help, I am able to run the code prog02\_02.f90 with toolbox module: toolbox.f90 located in the same folder.

but I have to copy the toolbox.f90 everytime when I need to compile a new source code.

I am trying to find out how to compile the two code in separate directory.  
so I put toolbox.f90 in a folder called toolbox\_module: it contains toolbox.f90, toolbox.mod, toolbox.o

when I run: gfortran prog02\_02.f90 -I cygdrive/c/users/yangzhe/downloads/ce-fortran-main/toolbox\_module  
it gives me error:  
15 | use toolbox  
| 1  
Fatal Error: Cannot open module file ‘toolbox.mod’ for reading at (1): No such file or directory

looks like my module directory in cygwin is the reason that it could not find the toolbox.mod file which I can see in the folder of toolbox\_module.

do i have to copy all the source code to cygwin directory system? or I can change the directory structure to run it?

Many thanks  
Martin

 ![cygwin](https://global.discourse-cdn.com/free1/uploads/fortran_lang/original/2X/2/21756d2884aba7a1acda24f9e33a3af039955cda.png)

---

<div class="post-metadata">

### Author: ![mecej4](https://yyz2.discourse-cdn.com/free1/user_avatar/fortran-lang.discourse.group/mecej4/32/855_2.png) [@mecej4](https://fortran-lang.discourse.group/u/mecej4)
#### Post date: [April 29, 2022, 1:41am UTC](https://fortran-lang.discourse.group/t/cygwin-directory-structure/3346/2 "2022-04-29T01:41:27Z")

</div>

> [@martiny1](#):
>
> gfortran prog02\_02.f90 -I cygdrive/c/users/yangzhe/downloads/ce-fortran-main/toolbox\_module

The command

```auto
gfortran prog02_02.f90 -I cygdrive/c/users/yangzhe/downloads/ce-fortran-main/toolbox_module

```

is missing the leading ‘/’ before “cygdrive”.

Your screenshot shows a different command, in which you use the backslash as separator rather than ‘/’. As you can see, the command interpreter removed all the backslashes and came up with the non-existent path **cygdrivecusersyangzhedownloadsce-fortran-maintoolbox\_module**

Read the documentation and use Cygwin properly.

---

<div class="post-metadata">

### Author: ![martiny1](https://avatars.discourse-cdn.com/v4/letter/m/bc8723/32.png) [@martiny1](https://fortran-lang.discourse.group/u/martiny1)
#### Post date: [April 29, 2022, 2:10am UTC](https://fortran-lang.discourse.group/t/cygwin-directory-structure/3346/3 "2022-04-29T02:10:48Z")

</div>

Hi Mecej4,

Thanks for your quick help. it works. I thought I need to move all the code into cygwin home, lib, etc, folder to make it work, and overlooked the “/”. haha.

wish you a great day.

Martin
