forums.silverfrost.com Forum Index forums.silverfrost.com
Welcome to the Silverfrost forums
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

dbk_link4 Error

 
Post new topic   Reply to topic    forums.silverfrost.com Forum Index -> Support
View previous topic :: View next topic  
Author Message
alex21



Joined: 20 Apr 2011
Posts: 73
Location: Australia

PostPosted: Mon Feb 08, 2021 3:52 am    Post subject: dbk_link4 Error Reply with quote

I am trying to setup FTN95 in a minimalist way on our CI server to build our application, however on the server I get the following exception when calling dbk_link4:
Code:

PS C:\FTN95> dbk_link4

Unhandled Exception: System.TypeInitializationException: The type initializer for 'Salford.Linker' threw an exception. -
--> System.TypeInitializationException: The type initializer for 'Salford.Fortran.RTLibrary' threw an exception. ---> Sy
stem.DllNotFoundException: Unable to load DLL 'SALFLIBC.dll': The specified module could not be found. (Exception from H
RESULT: 0x8007007E)
   at Salford.Fortran.RTLibrary.__com_plus_initialise(Int32 hin)
   at Salford.Fortran.RTLibrary.InitLibrary()
   at Salford.Fortran.RTLibrary..cctor()
   --- End of inner exception stack trace ---
   at Salford.Fortran.RTLibrary.InitLibrary()
   at Salford.Linker..cctor()
   --- End of inner exception stack trace ---
   at Salford.Linker.Main(String[] args)


SALFLIBC.dll is in the same location as on my personal development machine but on the CI server I get the above error... How can I ensure it finds SALFLIBC.dll?

Thanks,
Alex.
Back to top
View user's profile Send private message MSN Messenger
Robert



Joined: 29 Nov 2006
Posts: 374
Location: Manchester

PostPosted: Mon Feb 08, 2021 10:12 am    Post subject: Reply with quote

Is salflibc.dll in the same place as dbk_link4?
Back to top
View user's profile Send private message Visit poster's website
alex21



Joined: 20 Apr 2011
Posts: 73
Location: Australia

PostPosted: Mon Feb 08, 2021 10:59 am    Post subject: Reply with quote

Yeah they are in the same folder and that folder is on the PATH. I am trying to deploy the CI server based on this docker image: https://hub.docker.com/_/microsoft-dotnet-framework-sdk/

mcr.microsoft.com/dotnet/framework/sdk:4.8

So I basically zipped up the installation and wrote a script to set it up the same as on my development machine, I then removed silverfrost completely from my development machine (deleted leftover folders, registry keys, cleaned path after uninstall) before running the same script the docker image runs to setup FTN95.

Testing on my development machine the build through jenkins works fine, but in the docker container calling dbk_link4 gives that error... So I am really not sure what the difference is between FTN95 on my dev machine and on the CI server I am trying to deploy to build my application.

This is the script I am using to setup FTN95 on both machines (FTN95.zip is simply my valid install zipped up):
Code:

COPY "./FTN95.zip" "C:/FTN95.zip"
RUN Expand-Archive -Path "C:/FTN95.zip" -DestinationPath "C:/FTN95"
RUN setx /M PATH $($Env:PATH + ';C:\\FTN95')
RUN New-Item -Path 'HKLM:\\SOFTWARE\\WOW6432Node\\Silverfrost\\Silverfrost FTN95' -Name '8.40' -Force
RUN Set-ItemProperty -Path 'HKLM:\\SOFTWARE\\WOW6432Node\\Silverfrost\\Silverfrost FTN95\\8.40' -Name InstallLocation -Value 'C:\\FTN95' -Type ExpandString
RUN Remove-Item -Path "C:/FTN95.zip" -Force


Could it be I am missing a required .NET framework version for dbk_link4 or something?
Back to top
View user's profile Send private message MSN Messenger
Robert



Joined: 29 Nov 2006
Posts: 374
Location: Manchester

PostPosted: Mon Feb 08, 2021 11:06 am    Post subject: Reply with quote

The error message is saying that ftn95lib.dll can't find salflibc.dll. Often ftn95lib.dll lives in the GAC. Can you run dbk_link4 in a command prompt?
Back to top
View user's profile Send private message Visit poster's website
alex21



Joined: 20 Apr 2011
Posts: 73
Location: Australia

PostPosted: Mon Feb 08, 2021 11:14 am    Post subject: Reply with quote

I get the same error just typing it into a console, I did copy the ftn95lib stuff out of redist into the bin with the dbk_link4.exe a while ago because it complained it could not find it. But I assumed I removed all the DLL files on my dev machine as well when I removed it and restored it from a zip of my FTN95 folder, but not getting the error on my development machine.

Could I have missed a step where these DLLs are actually registered? But the locations are different after using the script to restore the install and it still works on there.
Back to top
View user's profile Send private message MSN Messenger
alex21



Joined: 20 Apr 2011
Posts: 73
Location: Australia

PostPosted: Mon Feb 08, 2021 11:16 am    Post subject: Reply with quote

CLI inside docker container gives this:
Code:

C:\>dbk_link4

Unhandled Exception: System.TypeInitializationException: The type initializer fo
r 'Salford.Linker' threw an exception. ---> System.TypeInitializationException:
The type initializer for 'Salford.Fortran.RTLibrary' threw an exception. ---> Sy
stem.DllNotFoundException: Unable to load DLL 'SALFLIBC.dll': The specified modu
le could not be found. (Exception from HRESULT: 0x8007007E)
   at Salford.Fortran.RTLibrary.__com_plus_initialise(Int32 hin)
   at Salford.Fortran.RTLibrary.InitLibrary()
   at Salford.Fortran.RTLibrary..cctor()
   --- End of inner exception stack trace ---
   at Salford.Fortran.RTLibrary.InitLibrary()
   at Salford.Linker..cctor()
   --- End of inner exception stack trace ---
   at Salford.Linker.Main(String[] args)


Development machine setup using the same script (but previously installed with installer) works fine:
Code:

C:\Users\alexh>dbk_link4
[DBK_LINK Ver. 4.1.1 Copyright(c) Silverfrost Ltd 2001-2018]
Back to top
View user's profile Send private message MSN Messenger
Robert



Joined: 29 Nov 2006
Posts: 374
Location: Manchester

PostPosted: Mon Feb 08, 2021 12:28 pm    Post subject: Reply with quote

This is the declaration:

Code:

        [SuppressUnmanagedCodeSecurity()]
            [DllImport("SALFLIBC.dll",CallingConvention=CallingConvention.Cdecl)]
            private static extern void __com_plus_initialise(int hin);


Looks fairly straightforward that it cannot load salflibc.dll. Does ftn95.exe work - it also uses salflibc.dll.
Back to top
View user's profile Send private message Visit poster's website
alex21



Joined: 20 Apr 2011
Posts: 73
Location: Australia

PostPosted: Mon Feb 08, 2021 12:34 pm    Post subject: Reply with quote

Yeah my build script actually compiles all the FTN source files and fails at the very last step where it calls the linker... So that sounds even stranger if they both require the same DLL files as they are both in the same path.
Back to top
View user's profile Send private message MSN Messenger
Robert



Joined: 29 Nov 2006
Posts: 374
Location: Manchester

PostPosted: Mon Feb 08, 2021 3:59 pm    Post subject: Reply with quote

I am not really sure what to suggest. Usually the issue is ftn95lib.dll, it can end up being in the wrong GAC. I wonder if something like windbg would help determine what it is trying to load.
Back to top
View user's profile Send private message Visit poster's website
alex21



Joined: 20 Apr 2011
Posts: 73
Location: Australia

PostPosted: Mon Feb 08, 2021 11:13 pm    Post subject: Reply with quote

Cheers I will try debugging the issue a bit more as it would be good for the productivity of my team to get this working.

Thanks,
Alex.
Back to top
View user's profile Send private message MSN Messenger
Display posts from previous:   
Post new topic   Reply to topic    forums.silverfrost.com Forum Index -> Support All times are GMT + 1 Hour
Page 1 of 1

 
Jump to:  
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