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

error : LNK2019; LNK2001

Raphael_C_1
Beginner
670 Views

Hi,

I'm working on an old fortran project which was made on compaq visual Fortran. When I compile the project I have the following errors :

Error 1 error LNK2019: unresolved external symbol _ETIME@4 referenced in function _SECOND cpu.obj

Error 2 error LNK2001: unresolved external symbol _ETIME@4 main.obj

Error 3 error LNK2001: unresolved external symbol _ETIME@4 io.obj

Error 4 error LNK2019: unresolved external symbol _LNBLNK@8 referenced in function _INPUTREAD io.obj

Error 5 error LNK2019: unresolved external symbol _FDATE@8 referenced in function _WRT_STATE io.obj

Error 6 fatal error LNK1120: 3 unresolved externals Debug/WAHA3.exe

I have tried to link libraries like said in other topics but it didn't work as well. Can somebody help me?

Thanks.

0 Kudos
4 Replies
mecej4
Honored Contributor III
670 Views

The nonstandard RTL functions/subroutines ETIME, FDATE, etc. are not available if you use the /iface:cvf option. Unless you really need CVF compatibility (e.g., if you have a precompiled library which forces you to use /iface:cvf), do not use it.

I compiled your sources with "ifort /traceback /MD *.f" and it got compiled and linked with no problems.

If you do need CVF compatibility, you may consider editing your sources and adding directives to those subprograms from which the nonstandard routines are called -- directives that specify Intel default linkage rather than CVF linkage.

0 Kudos
Raphael_C_1
Beginner
670 Views

Did you compiled with terminal or visual studio? 

How can i compile my sources with "ifort /traceback /MD *.f" in visual studio? 

Thank you very much for your time!

0 Kudos
mecej4
Honored Contributor III
670 Views

I don't have much use for the VS IDE except when debugging, but that's not a significant issue here. The options /traceback and /MD are not important either. However, you do need to make sure that CVF compatibility is NOT specified in the compiler options in the IDE.

0 Kudos
Raphael_C_1
Beginner
670 Views

it works !

Thanks!

0 Kudos
Reply