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

error in converted code from compaq visual fortran

milad_m_
Beginner
312 Views

hi

my code written  in compaq visual fortran , now i converted to intel visual fortran (in visual studio) from this refrence

https://software.intel.com/en-us/articles/migrating-from-compaq-visual-fortran

so when run it i face this to error that  cant find reason!

errors:

1     error LNK2019: unresolved external symbol _GETTIM@16 referenced in function _MAIN__     TINAK.obj    

2     fatal error LNK1120: 1 unresolved externals    Debug/TINAK.exe    

What Should I do?

im new ,please clear it!

thanks

with regard

0 Kudos
1 Solution
mecej4
Honored Contributor III
312 Views

A simple fix is to add "USE IFPORT" at the beginning of every subprogram from which a call to GETTIM is made. A better fix is replace calls to the non-standard routine GETTIM with calls to the intrinsic subroutine CPU_TIME or SYSTEM_CLOCK, as appropriate.

It appears that your ported program is still using the stdcall linkage convention. Please consider converting to the default convention in Intel Fortran, which is the CREF (cdecl by reference) convention.

View solution in original post

0 Kudos
2 Replies
mecej4
Honored Contributor III
313 Views

A simple fix is to add "USE IFPORT" at the beginning of every subprogram from which a call to GETTIM is made. A better fix is replace calls to the non-standard routine GETTIM with calls to the intrinsic subroutine CPU_TIME or SYSTEM_CLOCK, as appropriate.

It appears that your ported program is still using the stdcall linkage convention. Please consider converting to the default convention in Intel Fortran, which is the CREF (cdecl by reference) convention.

0 Kudos
milad_m_
Beginner
312 Views

wow!

replace GETTIM  with CPU_TIME

work!

for find the solution, i search and read many things for many time in net.

but  " ask a question is the best!  "

thanks

0 Kudos
Reply