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

libifcoremt.lib(for_main.obj) : error LNK2019: unresolved external symbol MAIN__ referenced in function main

trion
Beginner
2,750 Views

Hi, all! I am using intel fortran on Windows. When I link I get the Error

1>libifcoremt.lib(for_main.obj) : error LNK2019: unresolved external symbol MAIN__ referenced in function main
1>x64\\Debug\\Console8.exe : fatal error LNK1120: 1 unresolved externals

What I am doing wrong? Project files with build log in attachments.

Thanks,

Dmitriy

0 Kudos
3 Replies
psantos
Beginner
2,750 Views
Hello Trion,

the linker error simply tells you that you don't have a main program in your console application. So you must do something like this:

[bash]program main 
C call the subroutine vumat() 
end program main

subroutine vumat(
C Read only -
     1  nblock, ndir, nshr, nstatev, nfieldv, nprops, lanneal,
     2  stepTime, totalTime, dt, cmname, coordMp, charLength,
     3  props, density, strainInc, relSpinInc,
     4  tempOld, stretchOld, defgradOld, fieldOld,
     3  stressOld, stateOld, enerInternOld, enerInelasOld,
     6  tempNew, stretchNew, defgradNew, fieldNew,
C Write only -
     5  stressNew, stateNew, enerInternNew, enerInelasNew )
.
.
.[/bash]

You can use the main program simply as a test driver if you want to.

Pedro
0 Kudos
trion
Beginner
2,750 Views
I need to know how to do obj without main function, because this file is used in abaqus and in this program it doesn't work with it

I have tried to do bat file with paths to libriries, but it doesnt help me

Any idea what I can do about this?
0 Kudos
psantos
Beginner
2,750 Views
Trion,

When you say obj you mean generating the .obj files? If this is what you want you just need to compile the source code. Under the Visual Studio go to the menu build then compile. The .obj are generated during the compilation. The error you are getting is a linker error. So if you only need the .obj you don't need to perform the link. I hope this solve your problem.

Pedro
0 Kudos
Reply