我正在尝试在我的Windows机器上启动并运行Fortran编译器,但由于某种原因我无法让它工作。我已经安装了最新MinGW的“基本设置”部分,我正在尝试编译一个简单的“Hello world”程序,但是我收到以下错误消息:
C:\MinGW>gfortran -o executable Hello.f90
c:/mingw/bin/../lib/gcc/mingw32/8.2.0/../../../../mingw32/bin/ld.exe: unrecognized option '-plugin'
c:/mingw/bin/../lib/gcc/mingw32/8.2.0/../../../../mingw32/bin/ld.exe: use the --help option for usage information
collect2.exe: error: ld returned 1 exit status
这是源文件供参考:
Hello.f90
program Hello
write (*,*) 'Hello, world!'
end program Hello
有没有人知道问题可能是什么?
编辑:版本信息
C:\Users\Angel>c:/mingw/bin/ld.exe --version
GNU ld version 2.17.50 20060824
Copyright 2005 Free Software Foundation, Inc.
This program is free software; you may redistribute it under the terms of
the GNU General Public License. This program has absolutely no warranty.
你的链接器(binutils ld
v2.17.50)对你的gfortran
前端来说太旧了(v8.2.0
)。 -plugin
选项gfortran
在qamxswpoi v2.21.51中仅支持ld
传递给连接样板中的ld
。
这意味着你没有一个连贯的gfortran
工具链。 Binutils v2.17.50于2007年6月发布; 2018年7月的GCC 8.2。可能你已经在一个过时的MinGW版本上安装了gfortran
8.2。
你可能会建议完全删除你的MinGW安装并用current mingw-w64 release替换它,你可以用download at Sourceforge。