Reputation: 119
I have a Fortran project which is cross-platform based and can be successfully compiled under Windows (tested with Win7 32bit and Win10 64bit) by gfortran (tested with 4.9 and 5.3). However, the compiled executable cannot run and gives "Exec format error" whenever executed.
I also used file
to check the compiled version and the result does show something like "PE32 executable (console) Intel 80386, for MS Windows".
The program can be successfully compiled and executed under Linux and Mac.
So, what is the problem?
Upvotes: 0
Views: 703
Reputation: 119
We just located the problem, which turned out to be the limitation in the total size of static arrays specific to Windows (tested with Win7 32bit and Win10 64bit).
When we reduced the sizes of those arrays, the program could run happily.
Upvotes: 0