 |
forums.silverfrost.com Welcome to the Silverfrost forums
|
View previous topic :: View next topic |
Author |
Message |
alex21
Joined: 20 Apr 2011 Posts: 75 Location: Australia
|
Posted: Fri Jun 20, 2014 2:30 am Post subject: Internal Linker Error |
|
|
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:
Quote: |
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:
Code: |
!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:
Code: |
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. |
|
Back to top |
|
 |
PaulLaidler Site Admin
Joined: 21 Feb 2005 Posts: 8210 Location: Salford, UK
|
Posted: Fri Jun 20, 2014 7:33 am Post subject: |
|
|
Unfortunately we would need a small "working" sample program in order to resolve this issue. |
|
Back to top |
|
 |
alex21
Joined: 20 Apr 2011 Posts: 75 Location: Australia
|
Posted: Mon Jun 30, 2014 6:54 am Post subject: |
|
|
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. |
|
Back to top |
|
 |
PaulLaidler Site Admin
Joined: 21 Feb 2005 Posts: 8210 Location: Salford, UK
|
Posted: Mon Jun 30, 2014 7:08 am Post subject: |
|
|
I am sure to the extent that I cannot think of an alternative at the moment. |
|
Back to top |
|
 |
alex21
Joined: 20 Apr 2011 Posts: 75 Location: Australia
|
Posted: Tue Jul 01, 2014 4:18 am Post subject: |
|
|
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:
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
|
|
|
Back to top |
|
 |
PaulLaidler Site Admin
Joined: 21 Feb 2005 Posts: 8210 Location: Salford, UK
|
Posted: Tue Jul 01, 2014 6:54 am Post subject: |
|
|
I have logged this for investigation but given the complexity of this issue I recommend that you try to find a work-around. |
|
Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|