views:

81

answers:

2

I'm having trouble getting a simple piece of fortran90 code to work. Here is the code for helloworld.f90:

PROGRAM hello
 IMPLICIT NONE

 PRINT *,"Hello world!"

END PROGRAM hello

When I compile and build, there are no errors. But as soon as I click on execute, this error appears in the command prompt:

'"./helloworld"' is not recognized as an internal or external command, operable program or batch file.

How do I get it to work? I'm using geany as an IDE, and when using Ubuntu linux it works just fine. It's when I run it under windows 7 that I get this problem. These are the compile and build commands:

Compile: gfortran -Wall -c "helloworld.f90" (in directory: C:\Users\Eddy\Documents\Code\Fortran)
Build: gfortran -Wall -o "helloworld" "helloworld.f90" (in directory: C:\Users\Eddy\Documents\Code\Fortran)
A: 

It turns out I didn't have the fortran compiler installed after all! I followed the instructions from here to install it.

Eddy
I would have thought the lack of fortran compiler would have showed up as a compiler error
Eddy
+1  A: 

Something is wrong with your Geany.

./helloworld

will not work under Windows. It's from *nix world.

Instead of Geany you can use any text editor with Fortran support (for Windows take a look at jEdit, Programmer's Notepad). Or use Geany as editor but do compilation and execution from command-line.

If you want an IDE install Eclipse and then Photran.

kemiisto