Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.
Announcements
Welcome to the Intel Community. If you get an answer you like, please mark it as an Accepted Solution to help others. Thank you!

Linking errors

vinjarapu__sai_hema_
204 Views

Hi, 

I am trying to debug my Fortran source code. However, when I build the project with the source codes, I get these linking errors:

LINK : warning LNK4217: symbol '_DMS_RGLOB' defined in 'aspenwrapper.obj' is imported by 'aspenwrapper.obj' in function '_GMELCU'

LINK : warning LNK4217: symbol '_DMS_PLEX' defined in 'aspenwrapper.obj' is imported by 'aspenwrapper.obj' in function '_GMELCU'

LINK : warning LNK4217: symbol '_DMS_NCOMP' defined in 'aspenwrapper.obj' is imported by 'aspenwrapper.obj' in function '_GMELCU'

LINK : warning LNK4286: symbol '_PPUTL_PPGLOB' defined in 'aspenwrapper.obj' is imported by 'aspenwrapper.obj'

LINK : warning LNK4286: symbol '_PPEXEC_USER' defined in 'aspenwrapper.obj' is imported by 'aspenwrapper.obj'

aspenwrapper.obj : error LNK2019: unresolved external symbol _DMS_WRTTRM referenced in function _WRITEASPEN

aspenwrapper.obj : error LNK2019: unresolved external symbol _DMS_IFCMNC referenced in function _GMELCU libifcoremdd.lib(for_main.obj) :

error LNK2019: unresolved external symbol _MAIN__ referenced in function _main

Debug\Aspendebug.exe : fatal error LNK1120: 3 unresolved externals

DMS_RGLOB, DMS_PLEX, DMS_NCOMP, PPUTL_PPGLOB, and PPEXEC_USER are .cmn files that are provided by Aspen, which were included in the source code by using: #include 'dms_rglob.cmn'. I've been unable to figure out how to solve this issue. Any help would be appreciated.

Thank you.

0 Kudos
3 Replies
Arjen_Markus
Valued Contributor III
204 Views

I do not know the Aspen software but a reason for this type of error messages is that you forgot to include some library at the link step. Could you show what these .cmn file look like? How do you use these symbols, DMS_RGLOB, for instance? Is it s a subroutine or function? Some external data?

Included files are simply pieces of Fortran code - the ".cmn" extension is arbitrary, but it suggests that common block are involved. So it is of interest to see what the typical content is of such files.

vinjarapu__sai_hema_
204 Views

DMS_RGLOB appears to be defining and storing variables. I am attaching a screenshot of it. Is it in Linker => General => Additional Library directories,  that I have to give the directories for the libraries?

 

Arjen_Markus
Valued Contributor III
204 Views

Right, these are COMMON-blocks defined in a DLL. You would have to specify the import library for this DLL in the Linker => General => Input => Additional Dependencies. The documentation for the Aspen software should give you the proper name.

Reply