Silverfrost Forums

Welcome to our forums

Internal Linker Error

20 Jun 2014 1:30 #14240

Hello,

I have dealt with these errors before and in some cases the internal linker error is just caused by incorrect type casting or something, but in this case I cannot figure it out at all.

Here is what the build log says:

Command line for link: dbk_link4.exe /VS7 /NO_BANNER /MULTI_THREADED /INTERFACE_ONLY /CC:MEDLIEngine /VER:2.0.0.0 /REF:'..\Common\obj\Debug\Common.dll';'..\Domain\obj\Debug\Domain.dll';'C:\Windows\Microsoft.NET\Framework\v4.0.30319\System.dll';'C:\Windows\Microsoft.NET\Framework\v4.0.30319\System.Data.dll';'C:\Windows\Microsoft.NET\Framework\v4.0.30319\System.XML.dll' 'Debug\NET\Project.dll' @'C:\Users\user\Documents\project\PROJECT\Project\link.lst'

Linker output: LINK : error : Internal Linker Error

There is a lot of code involved but I will try to give you an idea of what lines are causing it:

         !Pathogen Output     !@@ THESE 3 LINES BELOW CAUSE INTERNAL LINKER ERROR
        IF (AERO1 .or. AERO2) then
           !Output%SustainabilityDiagnosticData%PathogenRunMessages%PathogenOutput%TotalNumberExposures = ingest_air_freqtot  !NoUnits
        ELSEIF (DIRECTs) then
           !Output%SustainabilityDiagnosticData%PathogenRunMessages%PathogenOutput%TotalNumberExposures = ingest_liq_freqtot !NoUnits
        ELSE
           !Output%SustainabilityDiagnosticData%PathogenRunMessages%PathogenOutput%TotalNumberExposures = ingest_liq_freqtot  !NoUnits
        ENDIF

However the following code which accessing the same part of the model does not cause the linker error:

           do i = 1, nbugsi
           Output%SustainabilityDiagnosticData%PathogenRunMessages%PathogenOutput%PathogenInfectionRiskAllEventsDetailArray(i-1)%PathogenSpecies = bugsppi(i) !NoUnits
           IF (AERO1 .or. AERO2) then
             Output%SustainabilityDiagnosticData%PathogenRunMessages%PathogenOutput%PathogenInfectionRiskAllEventsDetailArray(i-1)%InfectionRiskAllEvents = pry(air,0,i) !No. extra infections/10000 persons
           ELSEIF (DIRECTs) then
             Output%SustainabilityDiagnosticData%PathogenRunMessages%PathogenOutput%PathogenInfectionRiskAllEventsDetailArray(i-1)%InfectionRiskAllEvents = pry(liq,0,i)!No. extra infections/10000 persons
           ELSE
             Output%SustainabilityDiagnosticData%PathogenRunMessages%PathogenOutput%PathogenInfectionRiskAllEventsDetailArray(i-1)%InfectionRiskAllEvents = pry(liq,0,i) !No. extra infections/10000 persons
           ENDIF
       enddo

I have posted here about this kind of bug before but never really figured out how to debug what is going on, usually I simply just have to find the line that is causing it and correct some typing or something, but in this case I cannot ascertain anything that would be causing it.

Any help resolving this would be very appreciated, Thanks, Alex.

20 Jun 2014 6:33 #14241

Unfortunately we would need a small 'working' sample program in order to resolve this issue.

30 Jun 2014 5:54 #14299

Hey,

I am having quite a bit of trouble re-producing the error in a smaller sample application as it seems to be a very sensitive bug that is affected by a number of things.

In the case I detailed in my post it seems to be directly linked to the actual naming of the fields.

Are you sure there is no other way for me to provide more information on this issue without being able to replicate it in a sample application?

Thanks, Alex.

30 Jun 2014 6:08 #14300

I am sure to the extent that I cannot think of an alternative at the moment.

1 Jul 2014 3:18 #14307

Well download the files from this link: https://dl.dropboxusercontent.com/u/28956841/SampleProgram.zip

Its a small sample program I chucked together which resembles the shape of my project, I also chucked in some random code to make it do something, but most importantly I made it try to set the value of a property with a private setter, which although is not always the cause of 'Internal Linker Error', it is an easy way to demonstrate it.

FORTRAN code:

!
! Sample FORTRAN main subroutine
!

SUBROUTINE Main(Obj, D, O)
    USE ModUtility
    IMPLICIT NONE

    ! Declare .Net Interface
    ASSEMBLY_INTERFACE(NAME='Main')

    ! Declare variables
    OBJECT('System.Object'), INTENT(IN) :: Obj
    OBJECT('SampleDomain.SampleData'), INTENT(IN) :: D
    OBJECT('SampleDomain.SampleOutputData'), INTENT(OUT) :: O
    CHARACTER(LEN=11) :: FTNChar
    STRING :: FTNMessage

    ! Execute some FORTRAN code
    IF (IsSomething(Obj)) THEN
        CALL SetData(D, Obj)
    ELSE
        FTNChar = 'FTN message'
        FTNMessage = NEW@('System.String', FTNChar)
        CALL SetData(D, CAST@(FTNMessage, 'System.Object'))
    ENDIF
    CALL WriteSomething(D)

    ! Map output
    O = NEW@('SampleDomain.SampleOutputData', D)
    CALL SetOutputData(O, CreateDate(D%Year, D%Month, D%Day))
    O%Count = 1 ! This line causes 'Internal Linker Error'
END SUBROUTINE Main
1 Jul 2014 5:54 #14308

I have logged this for investigation but given the complexity of this issue I recommend that you try to find a work-around.

Please login to reply.