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

error LNK2019

jjgermis
ビギナー
1,848件の閲覧回数

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 件の賞賛
3 返答(返信)
Steven_L_Intel1
従業員
1,848件の閲覧回数
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.
jjgermis
ビギナー
1,848件の閲覧回数

Thanks, it works now!

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

Steven_L_Intel1
従業員
1,848件の閲覧回数
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.
返信