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: g开发者_运维百科fortran -Wall -o "helloworld" "helloworld.f90" (in directory: C:\Users\Eddy\Documents\Code\Fortran)
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.
It turns out I didn't have the fortran compiler installed after all! I followed the instructions from here to install it.
精彩评论