我正在尝试编译我的第一个fortran90程序Hello
Program Hello
Print *, "Hello World!"
End Program Hello西格温
$ g95 -o hello hello.f90
C:\cygwin64\tmp/ccPR6KU1.s: Assembler messages:
C:\cygwin64\tmp/ccPR6KU1.s:11: Error: invalid instruction suffix for `push'
C:\cygwin64\tmp/ccPR6KU1.s:28: Error: invalid instruction suffix for `push'从我的研究中,最常见的原因是将32位汇编代码与64位汇编程序混合,后者也被称为混合32位二进制程序和64位gcc。
但我的二进制不是32位。
$ cygcheck -c | grep binutils
binutils 2.29-1 OK
mingw64-i686-binutils-debuginfo 2.29.1.787c9873-1 OK
mingw64-x86_64-binutils 2.29.1.787c9873-1 OK
mingw64-x86_64-binutils-debuginfo 2.29.1.787c9873-1 OK这意味着什么,我如何着手解决这个问题?
我尝试过的其他事情
$ g95 -o -m32 hello hello.f90
same errors as previously plus
g95.exe: hello: No such file or directory$ gfortran -o hello hello.f90
gfortran: fatal error: -fuse-linker-plugin, but cyglto_plugin.dll not found
compilation terminated.$ f95 hello.f90 -o hello.exe
f95: fatal error: -fuse-linker-plugin, but cyglto_plugin.dll not found
compilation terminated.发布于 2019-09-19 06:24:47
找到了答案,here。原来我的gcc和gcc-fortran不是同一个版本的。
$ cygcheck -c | grep gcc
gcc-core 7.4.0-1 OK
gcc-debuginfo 7.4.0-1 OK
gcc-fortran 8.3.0-1 OK这就是我的工作
apt-cyg remove gcc-fortran
apt-cyg install gcc-fortranhttps://stackoverflow.com/questions/57992424
复制相似问题