Code Not Executing | What am I doing wrong

Hi ! I am a newbie to Fortran. I installed the GFortran via TDM-GCC, followed the installation wizard as was recommended. For the Editor I installed Geany.

Now I wrote a program in Geany called ‘area_of_circle.f90’ and saved it in the TDM-GCC-64 Folder on my C Drive (where GFortran was installed).

The issue is when I am trying to compile the program in MinGW Command Prompt, it is just not executing. I enter gfortran “filename.f90”, it waits up for a few seconds and then does nothing. I have tried all the recommended ways including reinstalling GFortran et al. My code is also fine without any issues.

Below I have linked a few screenshots of my program as well as the MinGW Commands. I request someone to please guide me! I use a Win11 x64 System.

This is the Second Image mentioned in Post 1


gfortran -o area_of_circle.exe area_of_circle.f90

The first instruction compile and link it, the second one execute it.

To automate running a program after compiling it, you can define a batch file called gfrun.bat (for example)

@ echo off
:: compile a Fortran program with up to 9 source files with gfortran and run the executable
if exist a.exe del a.exe
gfortran -Wall -Wextra -fbounds-check %1 %2 %3 %4 %5 %6 %7 %8 %9
if exist a.exe a.exe

and then issue a command

gfrun.bat area_of_circle.f90

I use such a batch file to try out small programs.

Just press the Build command button in Geany toolbar and then press the Execute button. With “Set Build Commands” from pull down menu, you can add more options to compiling and linking processes.