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

Error LNK2019

Hoang__Nhan_Hien
Beginner
589 Views

Hi,

I have a project including several sub-projects, named Bin_ (startup project depending on others), Cenvrl, Envrl_, Module_, OneD_, and ThreeD_. The OneD_ and ThreeD_ shares some functions with each other. The build order is Module_ -> Envrl_ -> ThreeD_ --> OneD _-> Cenvrl -> Bin_ and projects were build manually.

My problem is that all projects were successfully built except the Bin project. The following errors occurred for linking the created libraries, i.e., OneD_.lib and ThreeD_.lib.

Example errors:

----------------------------------------------------

2>OneD_.lib(ReadNewProblemM.obj) : error LNK2019: unresolved external symbol _INP_READ_ERROR@4 referenced in function _READNEWPROBLEMM_READNEWPROBLEM_mp_READCOBRA
2>OneD_.lib(ReadNewProblemM.obj) : error LNK2019: unresolved external symbol _TIMER_MOD_mp_TURN_TIMERS_ON@0 referenced in function _READNEWPROBLEMM_READNEWPROBLEM_mp_READCOBRA
2>OneD_.lib(ReadNewProblemM.obj) : error LNK2019: unresolved external symbol _TIMER_MOD_mp_CONSTRUCTOR@12 referenced in function _READNEWPROBLEMM_READNEWPROBLEM_mp_READCOBRA
2>OneD_.lib(ReadNewProblemM.obj) : error LNK2019: unresolved external symbol _TIMER_MOD_mp_START_TIMER@4 referenced in function _READNEWPROBLEMM_READNEWPROBLEM_mp_READCOBRA
2>OneD_.lib(ReadNewProblemM.obj) : error LNK2019: unresolved external symbol _INIT_TF_MOD_mp_INIT_TF@28 referenced in function _READNEWPROBLEMM_READNEWPROBLEM_mp_READCOBRA
2>OneD_.lib(ReadNewProblemM.obj) : error LNK2019: unresolved external symbol _NEW_COBRAI_MOD_mp_COBRAI@0 referenced in function _READNEWPROBLEMM_READNEWPROBLEM_mp_READCOBRA
2>OneD_.lib(ReadNewProblemM.obj) : error LNK2019: unresolved external symbol _CTF_MINOR_EDIT@0 referenced in function _READNEWPROBLEMM_READNEWPROBLEM_mp_READCOBRA

------------------------------------------

For me, there are two strange points here.

1. The ReadNewProblem.ReadCOBRA also calls other subroutines/functions of ThreeD (together with what resulted in unresolved external symbols), but the same error did not happen to them.

2.  Manually building ThreeD and OneD is successful, but failed when assembly their libraries for building Bin_.

Details building errors can be seen in the build log file that is attached here.

Could anyone help me solved this problem?

Thanks.

 

0 Kudos
2 Replies
mecej4
Honored Contributor III
572 Views

The presence of @NN suffixes added to the names of the missing external symbols indicates that you may be using incompatible settings for your "bin" project compared to the others. These suffixes are probably being generated because you selected CVF compatibility (or because you have DEC$ directives embedded in your source code).

You probably do not need to retain the CVF calling convention, which may have been used decades ago when you were using MS or DEC Fortran, unless you are using third party libraries for which you do not have source code and for which you are unable to obtain versions with Intel Fortran default linkage.

0 Kudos
Hoang__Nhan_Hien
Beginner
556 Views

Thank you so much. I spent a lot of time on this issue but did not succeed.

The errors were fixed now. I changed "Calling Convention" from CVF to default and it worked well.

0 Kudos
Reply