Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.

error LNK2019

jjgermis
Beginner
887 Views

Hi,

I am using IVF compiler 9.1 with Microsoft Visual Studio 2005 and get the following error when trying to compile a module and newbie with Microsoft Visual Studio:

------ Build started: Project: xmlparser, Configuration: Debug|Win32 ------

Compiling with Intel Fortran 9.1 C:ProgrammeIntelCompilerFortran9.1IA32...

ifort /nologo /Zi /Od /gen-interfaces /warn:interfaces /traceback /check:bounds /libs:static /threads /dbglibs /Qvc8 /Qlocation,link,"C:Program FilesMicrosoft Visual Studio 8VCin" "H:VisualStudioUserIncludexmlparse.f90"

libifcoremt.lib(libifcoremain.obj) : error LNK2019: unresolved external symbol _MAIN__ referenced in function _main
xmlparse.exe : fatal error LNK1120: 1 unresolved externals

xmlparser build failed.

This is a module that is working. The problem must be me not getting along with MVS 2005.

Some ideas to solve this?

Jacques

0 Kudos
3 Replies
Steven_L_Intel1
Employee
887 Views
I have seen this happen in the past where the linker is run after each compile. The fix for this is to go to Project > Properties > Fortran > Command Line and under Additional Options, type:

/c

This will prevent the linker from running as each source is compiled. The linker will be run after all sources are compiled.
0 Kudos
jjgermis
Beginner
887 Views

Thanks, it works now!

This is quite a difficult one to figure out if youtry to compile for the firts time.

0 Kudos
Steven_L_Intel1
Employee
887 Views
This problem should be fixed in 10.0 and later as we do things a bit differently. Most 9.1 users don't see this problem, but some do.
0 Kudos
Reply