在Windows 7中的geany下执行fortran代码不起作用
我无法让一段简单的 fortran90 代码正常工作。这是 helloworld.f90 的代码:
PROGRAM hello
IMPLICIT NONE
PRINT *,"Hello world!"
END PROGRAM hello
当我编译和构建时,没有错误。但是,一旦我单击“执行”,命令提示符中就会出现此错误:
'"./helloworld"' is not recognized as an internal or external command, operable program or batch file.
如何让它工作?我使用 geany 作为 IDE,当使用 Ubuntu linux 时它工作得很好。当我在Windows 7下运行它时,我遇到了这个问题。这些是编译和构建命令:
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)
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)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
原来我根本就没有安装fortran编译器!我按照此处的说明进行安装。
It turns out I didn't have the fortran compiler installed after all! I followed the instructions from here to install it.
您的 Geany 有问题。
在 Windows 下无法工作。它来自*nix世界。
除了 Geany,您还可以使用任何支持 Fortran 的文本编辑器(对于 Windows,请查看 jEdit、程序员的记事本)。或者使用 Geany 作为编辑器,但从命令行进行编译和执行。
如果您想要 IDE,请安装 Eclipse,然后安装 Photran.
Something is wrong with your Geany.
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.