Compiling a Fortran program under cygwin/gfortran gives “undefined reference to `_WinMain@16'”

后端 未结 1 579
礼貌的吻别
礼貌的吻别 2020-12-11 09:12

In the Cygwin terminal I enter

$ gfortran -o threed_euler_fluxes_v3.exe threed_euler_fluxes_v3.f90

and I get the compiler error



        
相关标签:
1条回答
  • 2020-12-11 09:44

    Your file is not a program at all! It is a collection of subprograms. You cannot compile it for running as a program, only as an object file or a library (try -c or -shared). You must add the main program body to be able to compile it as a program and run it!

    0 讨论(0)
提交回复
热议问题