1

I'm attempting to compile a relatively simple Fortran executable so that it can be passed around to other Windows users that don't have Cygwin (or something of the sort) installed, however, I'm unable to get the executable to operate as a standalone. I've tried gfortran -static file.f and gfortran -static-libgfortran file.f, however other users always encounter this error:

The program can’t start because cygwin1.dll is missing from your computer. Try reinstalling the program to fix this problem.

From what I've read online (e.g. here), the -static option should be sufficient. I have verified that running the executable from my machine (DOS prompt) does work.

I have gcc (gfortran) version 4.7.3. I should also point out this is my first attempt at compiling portable Fortran.

Update
After realizing that this isn't a gfortran-specific issue (thanks to replies here), searches led me to related posts here and here

1
  • No, but per your comment and the first answer, I will try this out and report back.
    – TTT
    Commented Oct 31, 2013 at 12:15

2 Answers 2

2

This is partially explained in the Cygwin FAQ. The solution is to install the mingw64-i686-gcc-fortran package with its dependencies, and cross-compile your code with i686-w64-mingw32-gfortran -static.

1

Just package the cygwin1.dll along with your binary file (both in the same folder) then it will run just fine.

Not the answer you're looking for? Browse other questions tagged or ask your own question.