使用MSYS2安装gfortran



作为一个完全的初学者,我很难使用MSYS2安装gfortran。我的最终目标是编译多个".for"文件并创建一个可执行文件。作为第一次尝试,我试图为一个简单的Fortran代码创建一个可执行文件。

我采取的步骤如下:

  1. 我已从https://www.msys2.org/
  2. 下载完成后,我启动了安装程序并接受了默认选项
  3. 安装程序建议运行MSYS2 64位,我接受了
  4. 我尝试使用命令pacman -Syu进行更新
  5. 由于我的工作计算机上的用户帐户没有管理权限,我出现了权限错误。我可以使用管理员密码运行程序(右键单击-以管理员身份运行(。但是,我需要编译器在登录到我的用户帐户时也能工作(没有管理权限(。我可能需要一些帮助来把事情做好
:: Synchronizing package databases...
error: failed to update mingw32 (unable to lock database)
error: failed to update mingw64 (unable to lock database)
error: failed to update ucrt64 (unable to lock database)
error: failed to update clang64 (unable to lock database)
error: failed to update msys (unable to lock database)
error: failed to synchronize all databases
  1. 我尝试以管理员身份运行MSYS2 64位,并使用命令pacman -Syu重复更新过程。这次一切都很顺利
:: Synchronizing package databases...
mingw32 is up to date   0.0   B  0.00   B/s 00:00 [---------------------]   0%
mingw64 is up to date   0.0   B  0.00   B/s 00:00 [---------------------]   0%
ucrt64 is up to date    0.0   B  0.00   B/s 00:00 [---------------------]   0%
clang64 is up to date   0.0   B  0.00   B/s 00:00 [---------------------]   0%
msys is up to date      0.0   B  0.00   B/s 00:00 [---------------------]   0%
:: Starting core system upgrade...
there is nothing to do
:: Starting full system upgrade...
there is nothing to do
  1. 使用记事本,我在目录"中创建了一个名为hello.for的文件;c/Users/User1/Desktop/CompileTry":
program HelloWorld
write (*,*) 'Hello, world'
end program HelloWorld
  1. 以管理员身份运行MSYS2 MinGW 64位时,我使用命令cd /c/Users/User1/Desktop/CompileTry将目录更改为工作目录
  2. 我尝试使用命令gfortran hello.for -o hello创建一个可执行文件
  3. 这是我得到的错误输出:
# gfortran hello.for -o hello
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/10.3.0/../../../../x86_64-w64-mingw32/bin/ld.exe: skipping incompatible C:/Program Files (x86)/Athena/g95/Lib/../lib/libmingw32.a when searching for -lmingw32
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/10.3.0/../../../../x86_64-w64-mingw32/bin/ld.exe: skipping incompatible C:/Program Files (x86)/Athena/g95/Lib/../liblibmingw32.a when searching for -lmingw32
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/10.3.0/../../../../x86_64-w64-mingw32/bin/ld.exe: skipping incompatible C:/Program Files (x86)/Athena/g95/Lib/../lib/libmoldname.a when searching for -lmoldname
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/10.3.0/../../../../x86_64-w64-mingw32/bin/ld.exe: skipping incompatible C:/Program Files (x86)/Athena/g95/Lib/../liblibmoldname.a when searching for -lmoldname
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/10.3.0/../../../../x86_64-w64-mingw32/bin/ld.exe: skipping incompatible C:/Program Files (x86)/Athena/g95/Lib/../lib/libmingwex.a when searching for -lmingwex
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/10.3.0/../../../../x86_64-w64-mingw32/bin/ld.exe: skipping incompatible C:/Program Files (x86)/Athena/g95/Lib/../liblibmingwex.a when searching for -lmingwex
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/10.3.0/../../../../x86_64-w64-mingw32/bin/ld.exe: skipping incompatible C:/Program Files (x86)/Athena/g95/Lib/../lib/libmsvcrt.a when searching for -lmsvcrt
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/10.3.0/../../../../x86_64-w64-mingw32/bin/ld.exe: skipping incompatible C:/Program Files (x86)/Athena/g95/Lib/../liblibmsvcrt.a when searching for -lmsvcrt
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/10.3.0/../../../../x86_64-w64-mingw32/bin/ld.exe: skipping incompatible C:/Program Files (x86)/Athena/g95/Lib/../lib/libkernel32.a when searching for -lkernel32
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/10.3.0/../../../../x86_64-w64-mingw32/bin/ld.exe: skipping incompatible C:/Program Files (x86)/Athena/g95/Lib/../liblibkernel32.a when searching for -lkernel32
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/10.3.0/../../../../x86_64-w64-mingw32/bin/ld.exe: skipping incompatible C:/Program Files (x86)/Athena/g95/Lib/../lib/libm.a when searching for -lm
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/10.3.0/../../../../x86_64-w64-mingw32/bin/ld.exe: skipping incompatible C:/Program Files (x86)/Athena/g95/Lib/../liblibm.a when searching for -lm
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/10.3.0/../../../../x86_64-w64-mingw32/bin/ld.exe: skipping incompatible C:/Program Files (x86)/Athena/g95/Lib/../lib/libmingw32.a when searching for -lmingw32
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/10.3.0/../../../../x86_64-w64-mingw32/bin/ld.exe: skipping incompatible C:/Program Files (x86)/Athena/g95/Lib/../liblibmingw32.a when searching for -lmingw32
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/10.3.0/../../../../x86_64-w64-mingw32/bin/ld.exe: skipping incompatible C:/Program Files (x86)/Athena/g95/Lib/../lib/libmoldname.a when searching for -lmoldname
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/10.3.0/../../../../x86_64-w64-mingw32/bin/ld.exe: skipping incompatible C:/Program Files (x86)/Athena/g95/Lib/../liblibmoldname.a when searching for -lmoldname
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/10.3.0/../../../../x86_64-w64-mingw32/bin/ld.exe: skipping incompatible C:/Program Files (x86)/Athena/g95/Lib/../lib/libmingwex.a when searching for -lmingwex
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/10.3.0/../../../../x86_64-w64-mingw32/bin/ld.exe: skipping incompatible C:/Program Files (x86)/Athena/g95/Lib/../liblibmingwex.a when searching for -lmingwex
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/10.3.0/../../../../x86_64-w64-mingw32/bin/ld.exe: skipping incompatible C:/Program Files (x86)/Athena/g95/Lib/../lib/libmsvcrt.a when searching for -lmsvcrt
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/10.3.0/../../../../x86_64-w64-mingw32/bin/ld.exe: skipping incompatible C:/Program Files (x86)/Athena/g95/Lib/../liblibmsvcrt.a when searching for -lmsvcrt
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/10.3.0/../../../../x86_64-w64-mingw32/bin/ld.exe: skipping incompatible C:/Program Files (x86)/Athena/g95/Lib/../lib/libkernel32.a when searching for -lkernel32
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/10.3.0/../../../../x86_64-w64-mingw32/bin/ld.exe: skipping incompatible C:/Program Files (x86)/Athena/g95/Lib/../liblibkernel32.a when searching for -lkernel32
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/10.3.0/../../../../x86_64-w64-mingw32/bin/ld.exe: skipping incompatible C:/Program Files (x86)/Athena/g95/Lib/../lib/libadvapi32.a when searching for -ladvapi32
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/10.3.0/../../../../x86_64-w64-mingw32/bin/ld.exe: skipping incompatible C:/Program Files (x86)/Athena/g95/Lib/../liblibadvapi32.a when searching for -ladvapi32
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/10.3.0/../../../../x86_64-w64-mingw32/bin/ld.exe: skipping incompatible C:/Program Files (x86)/Athena/g95/Lib/../lib/libshell32.a when searching for -lshell32
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/10.3.0/../../../../x86_64-w64-mingw32/bin/ld.exe: skipping incompatible C:/Program Files (x86)/Athena/g95/Lib/../liblibshell32.a when searching for -lshell32
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/10.3.0/../../../../x86_64-w64-mingw32/bin/ld.exe: skipping incompatible C:/Program Files (x86)/Athena/g95/Lib/../lib/libuser32.a when searching for -luser32
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/10.3.0/../../../../x86_64-w64-mingw32/bin/ld.exe: skipping incompatible C:/Program Files (x86)/Athena/g95/Lib/../liblibuser32.a when searching for -luser32
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/10.3.0/../../../../x86_64-w64-mingw32/bin/ld.exe: skipping incompatible C:/Program Files (x86)/Athena/g95/Lib/../lib/libkernel32.a when searching for -lkernel32
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/10.3.0/../../../../x86_64-w64-mingw32/bin/ld.exe: skipping incompatible C:/Program Files (x86)/Athena/g95/Lib/../liblibkernel32.a when searching for -lkernel32
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/10.3.0/../../../../x86_64-w64-mingw32/bin/ld.exe: skipping incompatible C:/Program Files (x86)/Athena/g95/Lib/../lib/libmingw32.a when searching for -lmingw32
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/10.3.0/../../../../x86_64-w64-mingw32/bin/ld.exe: skipping incompatible C:/Program Files (x86)/Athena/g95/Lib/../liblibmingw32.a when searching for -lmingw32
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/10.3.0/../../../../x86_64-w64-mingw32/bin/ld.exe: skipping incompatible C:/Program Files (x86)/Athena/g95/Lib/../lib/libmoldname.a when searching for -lmoldname
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/10.3.0/../../../../x86_64-w64-mingw32/bin/ld.exe: skipping incompatible C:/Program Files (x86)/Athena/g95/Lib/../liblibmoldname.a when searching for -lmoldname
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/10.3.0/../../../../x86_64-w64-mingw32/bin/ld.exe: skipping incompatible C:/Program Files (x86)/Athena/g95/Lib/../lib/libmingwex.a when searching for -lmingwex
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/10.3.0/../../../../x86_64-w64-mingw32/bin/ld.exe: skipping incompatible C:/Program Files (x86)/Athena/g95/Lib/../liblibmingwex.a when searching for -lmingwex
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/10.3.0/../../../../x86_64-w64-mingw32/bin/ld.exe: skipping incompatible C:/Program Files (x86)/Athena/g95/Lib/../lib/libmsvcrt.a when searching for -lmsvcrt
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/10.3.0/../../../../x86_64-w64-mingw32/bin/ld.exe: skipping incompatible C:/Program Files (x86)/Athena/g95/Lib/../liblibmsvcrt.a when searching for -lmsvcrt
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/10.3.0/../../../../x86_64-w64-mingw32/bin/ld.exe: skipping incompatible C:/Program Files (x86)/Athena/g95/Lib/../lib/libkernel32.a when searching for -lkernel32
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/10.3.0/../../../../x86_64-w64-mingw32/bin/ld.exe: skipping incompatible C:/Program Files (x86)/Athena/g95/Lib/../liblibkernel32.a when searching for -lkernel32
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/10.3.0/../../../../x86_64-w64-mingw32/bin/ld.exe: i386 architecture of input file `C:/Program Files (x86)/Athena/g95/Lib/../lib/crt2.o' is incompatible with i386:x86-64 output
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/10.3.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:/Program Files (x86)/Athena/g95/Lib/../lib/crt2.o:crt1.c:(.text+0x38): undefined reference to `_signal'
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/10.3.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:/Program Files (x86)/Athena/g95/Lib/../lib/crt2.o:crt1.c:(.text+0x9c): undefined reference to `_signal'
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/10.3.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:/Program Files (x86)/Athena/g95/Lib/../lib/crt2.o:crt1.c:(.text+0xcc): undefined reference to `_signal'
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/10.3.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:/Program Files (x86)/Athena/g95/Lib/../lib/crt2.o:crt1.c:(.text+0xd9): undefined reference to `__fpreset'
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/10.3.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:/Program Files (x86)/Athena/g95/Lib/../lib/crt2.o:crt1.c:(.text+0xf0): undefined reference to `_signal'
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/10.3.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:/Program Files (x86)/Athena/g95/Lib/../lib/crt2.o:crt1.c:(.text+0x120): undefined reference to `_signal'
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/10.3.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:/Program Files (x86)/Athena/g95/Lib/../lib/crt2.o:crt1.c:(.text+0x13a): undefined reference to `_signal'
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/10.3.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:/Program Files (x86)/Athena/g95/Lib/../lib/crt2.o:crt1.c:(.text+0x15f): undefined reference to `_SetUnhandledExceptionFilter@4'
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/10.3.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:/Program Files (x86)/Athena/g95/Lib/../lib/crt2.o:crt1.c:(.text+0x167): undefined reference to `___cpu_features_init'
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/10.3.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:/Program Files (x86)/Athena/g95/Lib/../lib/crt2.o:crt1.c:(.text+0x16c): undefined reference to `__fpreset'
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/10.3.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:/Program Files (x86)/Athena/g95/Lib/../lib/crt2.o:crt1.c:(.text+0x17f): undefined reference to `__CRT_glob'
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/10.3.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:/Program Files (x86)/Athena/g95/Lib/../lib/crt2.o:crt1.c:(.text+0x19f): undefined reference to `___getmainargs'
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/10.3.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:/Program Files (x86)/Athena/g95/Lib/../lib/crt2.o:crt1.c:(.text+0x1a4): undefined reference to `__CRT_fmode'
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/10.3.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:/Program Files (x86)/Athena/g95/Lib/../lib/crt2.o:crt1.c:(.text+0x1ad): undefined reference to `__fmode'
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/10.3.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:/Program Files (x86)/Athena/g95/Lib/../lib/crt2.o:crt1.c:(.text+0x1b3): undefined reference to `__imp___iob'
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/10.3.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:/Program Files (x86)/Athena/g95/Lib/../lib/crt2.o:crt1.c:(.text+0x1c5): undefined reference to `__CRT_fmode'
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/10.3.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:/Program Files (x86)/Athena/g95/Lib/../lib/crt2.o:crt1.c:(.text+0x1ce): undefined reference to `__imp___iob'
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/10.3.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:/Program Files (x86)/Athena/g95/Lib/../lib/crt2.o:crt1.c:(.text+0x1d9): undefined reference to `__setmode'
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/10.3.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:/Program Files (x86)/Athena/g95/Lib/../lib/crt2.o:crt1.c:(.text+0x1df): undefined reference to `__imp___iob'
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/10.3.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:/Program Files (x86)/Athena/g95/Lib/../lib/crt2.o:crt1.c:(.text+0x1e9): undefined reference to `__CRT_fmode'
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/10.3.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:/Program Files (x86)/Athena/g95/Lib/../lib/crt2.o:crt1.c:(.text+0x1f2): undefined reference to `__imp___iob'
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/10.3.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:/Program Files (x86)/Athena/g95/Lib/../lib/crt2.o:crt1.c:(.text+0x1fd): undefined reference to `__setmode'
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/10.3.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:/Program Files (x86)/Athena/g95/Lib/../lib/crt2.o:crt1.c:(.text+0x211): undefined reference to `___p__fmode'
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/10.3.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:/Program Files (x86)/Athena/g95/Lib/../lib/crt2.o:crt1.c:(.text+0x217): undefined reference to `__fmode'
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/10.3.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:/Program Files (x86)/Athena/g95/Lib/../lib/crt2.o:crt1.c:(.text+0x21e): undefined reference to `__pei386_runtime_relocator'
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/10.3.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:/Program Files (x86)/Athena/g95/Lib/../lib/crt2.o:crt1.c:(.text+0x226): undefined reference to `___main'
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/10.3.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:/Program Files (x86)/Athena/g95/Lib/../lib/crt2.o:crt1.c:(.text+0x22b): undefined reference to `___p__environ'
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/10.3.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:/Program Files (x86)/Athena/g95/Lib/../lib/crt2.o:crt1.c:(.text+0x247): undefined reference to `_main'
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/10.3.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:/Program Files (x86)/Athena/g95/Lib/../lib/crt2.o:crt1.c:(.text+0x24e): undefined reference to `__cexit'
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/10.3.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:/Program Files (x86)/Athena/g95/Lib/../lib/crt2.o:crt1.c:(.text+0x256): undefined reference to `_ExitProcess@4'
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/10.3.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:/Program Files (x86)/Athena/g95/Lib/../lib/crt2.o:crt1.c:(.text+0x265): undefined reference to `__imp___iob'
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/10.3.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:/Program Files (x86)/Athena/g95/Lib/../lib/crt2.o:crt1.c:(.text+0x270): undefined reference to `__setmode'
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/10.3.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:/Program Files (x86)/Athena/g95/Lib/../lib/crt2.o:crt1.c:(.text+0x276): undefined reference to `__imp___iob'
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/10.3.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:/Program Files (x86)/Athena/g95/Lib/../lib/crt2.o:crt1.c:(.text+0x28f): undefined reference to `__imp____set_app_type'
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/10.3.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:/Program Files (x86)/Athena/g95/Lib/../lib/crt2.o:crt1.c:(.text+0x2af): undefined reference to `__imp____set_app_type'
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/10.3.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:/Program Files (x86)/Athena/g95/Lib/../lib/crt2.o:crt1.c:(.text+0x2c3): undefined reference to `__imp__atexit'
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/10.3.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:/Program Files (x86)/Athena/g95/Lib/../lib/crt2.o:crt1.c:(.text+0x2d3): undefined reference to `__imp___onexit'
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/10.3.0/../../../../x86_64-w64-mingw32/bin/ld.exe: ertr000001.o:(.rdata+0x0): undefined reference to `_pei386_runtime_relocator'
collect2.exe: error: ld returned 1 exit status
  1. 文件夹中没有创建可执行文件,这是唯一的错误消息

有人能帮我解决这个问题吗?

编辑:

命令printenv:的输出

.installerid=EA11LCT
.osfamily=10
ProgramFiles(x86)=C:Program Files (x86)
.installserver=rollout
.termserver=no
.source=\rolloutmasterrolloutsysadminEA11LCT
.rolloutpe=yes
.temp=C:temp
.id2=EA11LCT ANSYS Chemkin 17.0 - v15.64.15151 [EA11LCT]
CommonProgramFiles(x86)=C:Program Files (x86)Common Files
.jumpto=aEA11LCT_Chemkin17
.group=ea11.lct.wp
.id1=EA11LCT_Chemkin17
!C:=C:WindowsSystem32
.oslanguage=en
.IsLaptop=yes
.osid=10E1709E64
.installdate=12.04.2018
SHELL=/usr/bin/bash
NUMBER_OF_PROCESSORS=8
PROCESSOR_LEVEL=6
WD=C:msys64usrbin
TERM_PROGRAM_VERSION=3.5.0
MINGW_PREFIX=/mingw64
PKG_CONFIG_PATH=/mingw64/lib/pkgconfig:/mingw64/share/pkgconfig
HOSTNAME=ea11c317
PROGRAMFILES=C:Program Files
MSYSTEM=MINGW64
PATHEXT=.COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;.MSC
ORIGINAL_TEMP=/c/Users/ADMINI~1/AppData/Local/Temp
MINGW_CHOST=x86_64-w64-mingw32
OS=Windows_NT
UATDATA=C:WindowsCCMUATDataD9F8C395-CAB8-491d-B8AC-179A1FE1BE77
INTEL_DEV_REDIST=C:Program Files (x86)Common FilesIntelShared Libraries
MSYSTEM_CARCH=x86_64
USERDOMAIN=EA11C317
PWD=/home/Administrator
USERPROFILE=C:UsersAdministrator
IFORT_COMPILER15=C:Program Files (x86)IntelComposer XE 2015
IFORT_COMPILER11=C:Program Files (x86)IntelCompiler11.172
MANPATH=/mingw64/local/man:/mingw64/share/man:/usr/local/man:/usr/share/man:/usr/man:/share/man
PRINTER=PDFCreator
JD2_HOME=C:Program Files (x86)JDownloader 2.0
VS140COMNTOOLS=C:Program Files (x86)Microsoft Visual Studio 14.0Common7Tools
TZ=Europe/Brussels
LOG=C:DICTlogsdict.log
MINGW_PACKAGE_PREFIX=mingw-w64-x86_64
tmp=C:UsersAdministratorAppDataLocalTemp
ALLUSERSPROFILE=C:ProgramData
ORIGINAL_PATH=/c/Windows/System32:/c/Windows:/c/Windows/System32/Wbem:/c/Windows/System32/WindowsPowerShell/v1.0/
CommonProgramW6432=C:Program FilesCommon Files
HOME=/home/Administrator
USERNAME=Administrator
VBOX_MSI_INSTALL_PATH=C:Program FilesOracleVirtualBox
OneDrive=C:UsersAdministratorOneDrive
COMSPEC=C:WINDOWSsystem32cmd.exe
VTUNE_AMPLIFIER_2019_DIR=C:Program Files (x86)IntelSWToolsVTune Amplifier 2019
RoxioCentral=C:Program Files (x86)Common FilesRoxio Shared10.0Roxio Central36
VSSHELL2008INSTALLDIR=C:Program Files (x86)Microsoft Visual Studio 9.0
APPDATA=C:UsersAdministratorAppDataRoaming
SYSTEMROOT=C:WINDOWS
LOCALAPPDATA=C:UsersAdministratorAppDataLocal
PROMPT=$P$G
COMPUTERNAME=EA11C317
INFOPATH=/usr/local/info:/usr/share/info:/usr/info:/share/info
TERM=xterm
ACLOCAL_PATH=/mingw64/share/aclocal:/usr/share/aclocal
USER=EA11C317+Administrator
PSModulePath=C:Program FilesWindowsPowerShellModules;C:WINDOWSsystem32WindowsPowerShellv1.0Modules
LIBRARY_PATH=C:Program Files (x86)Athenag95Lib;C:Program Files (x86)Athenag95libgcc-libi686-pc-mingw324.0.4
TEMP=/tmp
temp=C:UsersAdministratorAppDataLocalTemp
MSYSTEM_CHOST=x86_64-w64-mingw32
ORIGINAL_TMP=/c/Users/ADMINI~1/AppData/Local/Temp
SHLVL=1
PROCESSOR_REVISION=8e0a
DriverData=C:WindowsSystem32DriversDriverData
COMMONPROGRAMFILES=C:Program FilesCommon Files
CONICON=mingw64.ico
LC_CTYPE=en_US.UTF-8
PROCESSOR_IDENTIFIER=Intel64 Family 6 Model 142 Stepping 10, GenuineIntel
PS1=[e]0;wa]n[e[32m]u@h [e[35m]$MSYSTEM[e[0m] [e[33m]w[e[0m]n[e[1m]#[e[0m]
XDG_DATA_DIRS=/mingw64/share/:/usr/local/share/:/usr/share/
MSYSCON=mintty.exe
TMP=/tmp
CONFIG_SITE=/etc/config.site
PATH=/mingw64/bin:/usr/local/bin:/usr/bin:/bin:/c/Windows/System32:/c/Windows:/c/Windows/System32/Wbem:/c/Windows/System32/WindowsPowerShell/v1.0/:/usr/bin/site_perl:/usr/bin/vendor_perl:/usr/bin/core_perl
ProgramW6432=C:Program Files
MSYSTEM_PREFIX=/mingw64
LOGINSHELL=bash
CONTITLE=MinGW x64
MIC_LD_LIBRARY_PATH=C:Program Files (x86)Common FilesIntelShared Librariescompilerlibmic
INTEL_LICENSE_FILE=C:Program Files (x86)Common FilesIntelLicenses
WINDIR=C:WINDOWS
PROCESSOR_ARCHITECTURE=AMD64
PUBLIC=C:UsersPublic
LIB=C:Program Files (x86)AthenaLib
SYSTEMDRIVE=C:
OLDPWD=/c/WINDOWS/system32
TERM_PROGRAM=mintty
ProgramData=C:ProgramData
_=/usr/bin/printenv

在带有Windows的新DELL上安装Fortran时也遇到了类似的问题。我在现在的电脑上安装MSYS2和Fortran已经三年了,所以我忘记了我是怎么做到的

按照github上msys2页面上的说明安装msys2开始,我创建了一个目录c:\msys64\,其中包含一个可执行文件mingw64.exe(和我在桌面上做了一个快捷方式,就像我在旧电脑上一样(。

但在试图找到包含Fortran编译器的包时,我迷失了方向。有一些包,比如mingw-w64-x86_64-gcc-libgfortran,但添加了pacman-S。。。仅包含lib文件。我用pacman-Q列出包裹,但没有包裹";mingw-w64-x86_64-gcc-fortran";(正如@HolyBlackCat在评论中提出的(被列出。

但根据这个建议,我进行了测试:pacman-S mingw-w64-x86_64-gcc-fortran这就奏效了!

我感谢那些开发和更新msys2包的人所做的辛勤工作,我也感谢堆栈溢出帮助我找到这个包。但也许可以更容易地找到东西。

我注意到在安装软件包mingw-w64-x86_64-gcc-fortran之后当我尝试pacman-Q时,这个包已经列出了也许是帕克曼的窃听器?

Bo Sundman 公司

最新更新