Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
72 Views

Linking errors

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
Highlighted
Valued Contributor II
72 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.

0 Kudos
Highlighted
72 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?

 

0 Kudos
Highlighted
Valued Contributor II
72 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.

0 Kudos