The ChipList, by Adrian Offerman; The Processor Portal

Processor Selector

View: show / edit

bookmark bookmark site
bookmark permalink
Tue 23 Dec 2008, 21:39

Error LNK2019: unresolved external symbol _MAIN__

On Tue 23 Dec 2008, at 21:39, Intel Software Network - Main Articles Feed wrote:

Error LNK2019: unresolved external symbol _MAIN__
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.
Filed under: Intel® Visual Fortran Compiler for Windows*
Source: Intel Software Network - Main Articles Feed

ChipList news channel Last Months News

ChipList developers news channel Last Months Developers News

Page viewed 2865 times since Wed 24 Dec 2008, 1:41.