Cygwin directory structure

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

The command

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.

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