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

subroutine building error

keremusu1
Beginner
626 Views

Hello!

I would like to build an executable file (*.exe)by using the subroutine below.

subroutine hypela(d,g,e,de,s,temp,dtemp,ngens,n,nn,kc,mats,ndi,nshear)

implicit real*8 (a-h,o-z)

include '/msc/marc2003/common/concom'

dimension e(1),de(1),temp(1),dtemp(1),g(1),d(ngens,ngens),s(1)

dimension n(2)

if (ncycle.eq.0) epsend=e(1)

if (ncycle.gt.0) epsend=e(1)+de(1)

c1=1.0d0

c2=2.0d4

d(1,1)=c1+2.0d0*c2*epsend

s(1)=c1*epsend+c2*epsend*epsend

return

end

When I build the solution, I see the following errors:

Error1 error LNK2019: unresolved external symbol _MAIN__ referenced in function _mainlibifcoremt.lib
Error2 fatal error LNK1120: 1 unresolved externalsDebugConsole6.exe

Does anyone have an idea about what theproblem can be?

Thanks!

0 Kudos
1 Reply
Steven_L_Intel1
Employee
626 Views
You cannot build an executable from just a subroutine - you need a main program which calls the subroutine, passing it the necessary data.

You can build a DLL if you want which can then be used by a separately compiled program. Read the on-disk documentation for information on building libraries and DLLs.
0 Kudos
Reply