Problem : When compiling a Fortran source, you receive the message "error LNK2019: unresolved external symbol _MAIN__"
Environment : Windows
Root Cause : The source file you compiled did not include a Fortran main program. The compilation process invoked the linker in an attempt to link an executable program.
Resolution : If you are compiling a collection of individual sources to be linked later, add the /c option to specify compile-only. This is typically not needed when you are building from within Microsoft Visual Studio, but in versions of Intel Visual Fortran prior to 10.0 it is possible to find that Visual Studio tries to link each source individually. To resolve that, right click on the project, select Properties > Fortran > Command Line and in the "Additional Options" field, add or enter /c to the list of options.
If you are building a "Windows Application", that has an entry point of a function called WinMain, use the /winapp option when compiling at the command line, or create a "Windows Application" project in Microsoft Visual Studio.