

In the top section labeled "User variables for." there may or may not be an entry called PATH. Right click on My Computer, Properties, Advanced Tab, Environment Variables. Now we have to tell Windows to look in c:\gfortran\bin for the compiler.

you should also have a file gfortran.exe in c:\gfortran\bin. I opened a new command prompt, after the installation completed, and it still says "command not found"Ĭheck that you have indeed files in the directory you selected for installation (if you chose c:\gfortran as installation directory, you should have directories like c:\gfortran\bin c:\gfortran\include. The installer tries to add the gfortran program to your PATH environment variable, telling Windows where to look when you call for gfortran For this to work, the command prompt window must be opened after the installation is complete Open a new prompt window, and try again! When I type try to run gfortran, windows says "command not found" In the black window that opens, you can use gfortran to compile your Fortran code (assuming your program is file code.f95 in the current directory): gfortran code.f95 -o code.exe This creates an executable named code.exe. To open a command prompt, click on Start menu, choose Accessories and then Command Prompt, or choose Run and type "cmd". Gfortran is now available from command-line. See Windows for general GCC on Windows information. Please report any bugs to the mailing-list.

The installer sets your PATH environment variable, so that simply typing gfortran in a command prompt will run the compiler. Download the installer, and run it (accept the GNU Public License, choose an directory to install gfortran, and let it work for you!). Stand-alone gfortran binaries for Windows are available as an installer.
