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 

Use of DLLs

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



Joined: 27 Sep 2018
Posts: 27
Location: Australia

PostPosted: Thu Sep 27, 2018 11:16 pm    Post subject: Use of DLLs Reply with quote

I am a bit of an old fashioned command line programmer and struggle how to deal with DLLs . Do I integrate them via Plato? If so, where are they referenced in Plato? I have also tried direct linking following the advise in https://www.silverfrost.com/ftn95-help/slink/direct_linking_with_dlls.aspx , but can't get that to work.

Last edited by jcherw on Fri Sep 28, 2018 12:53 am; edited 1 time in total
Back to top
View user's profile Send private message
mecej4



Joined: 31 Oct 2006
Posts: 1024

PostPosted: Thu Sep 27, 2018 11:41 pm    Post subject: Reply with quote

From the command line, just specify the name of the DLL to the linker, as you would a static library. For example, if you write MyProg.F90, and that contains calls to one or more routines in TheirLib.DLL, do

FTN95 MyProg.F90
SLINK MyProg.obj TheirLib.DLL
Back to top
View user's profile Send private message
jcherw



Joined: 27 Sep 2018
Posts: 27
Location: Australia

PostPosted: Fri Sep 28, 2018 1:06 am    Post subject: Reply with quote

That's exactly what I did but it did not work.
Back to top
View user's profile Send private message
jcherw



Joined: 27 Sep 2018
Posts: 27
Location: Australia

PostPosted: Fri Sep 28, 2018 1:12 am    Post subject: Reply with quote

So I created a map file and it contains stuff like

EDATE@ - CLEARWIN64.DLL
R4@WSF - CLEARWIN64.DLL
SLEEP@ - CLEARWIN64.DLL

which in my view would indicate that the clearwin DLL is correctly linked

however there is a whole list of calls unresolved (see below) and those are clearwin calls as faras I understand from eg https://www.silverfrost.com/ftn95-help/clearwinp/library/rotate_font_.aspx

what am I missing ??????

ROTATE_FONT@ *Unresolved* -
DRAW_POINT@ *Unresolved* -
DRAW_FILLED_ELLIPSE@ *Unresolved* -
SIZE_IN_PIXELS@ *Unresolved* -
BOLD_FONT@ *Unresolved* -
DRAW_RECTANGLE@ *Unresolved* -
SET_LINE_WIDTH@ *Unresolved* -
DRAW_FILLED_RECTANGLE@ *Unresolved* -
DRAW_CHARACTERS@ *Unresolved* -
DRAW_LINE_BETWEEN@ *Unresolved* -
SET_MOUSE_CURSOR_POSITION@ *Unresolved* -
ADD_MENU_ITEM@ *Unresolved* -
Back to top
View user's profile Send private message
mecej4



Joined: 31 Oct 2006
Posts: 1024

PostPosted: Fri Sep 28, 2018 1:42 am    Post subject: Reply with quote

The fact that the missing externals have uppercase names and are decorated with '@' indicates that you forgot to USE CLRWIN or INCLUDE 'CLEARWIN.INS' in your source code.
Back to top
View user's profile Send private message
jcherw



Joined: 27 Sep 2018
Posts: 27
Location: Australia

PostPosted: Fri Sep 28, 2018 2:39 am    Post subject: Reply with quote

I had included already

use clrwin$

which is the 64 bit version of clearwin.ins (see https://www.silverfrost.com/ftn95-help/clearwinp/util/64bit.aspx)

Still getting teh same error on unresolved calls to various functions as per previous post
Back to top
View user's profile Send private message
jcherw



Joined: 27 Sep 2018
Posts: 27
Location: Australia

PostPosted: Fri Sep 28, 2018 4:15 am    Post subject: Reply with quote

I now replaced the use clrwin$ statement everywhere with

include <windows.ins>

and that fixes the unresolved calls.

Not sure however how this will work out for 64 bit as I understand that windows.ins was only for 32 bit ????

So big step forward, but ....
Back to top
View user's profile Send private message
jcherw



Joined: 27 Sep 2018
Posts: 27
Location: Australia

PostPosted: Fri Sep 28, 2018 4:33 am    Post subject: Reply with quote

Ok finally got sorted, I think. For 64 option the @ in the function calls need to be replaced by $ and than things seem to work w use clrwin$
Back to top
View user's profile Send private message
PaulLaidler
Site Admin


Joined: 21 Feb 2005
Posts: 5592
Location: Salford, UK

PostPosted: Fri Sep 28, 2018 7:35 am    Post subject: Reply with quote

For FTN95 you should use @ and USE CLRWIN.
For gFortran (or both FTN95 and gFortran) you should use $ and USE CLRWIN$.
Back to top
View user's profile Send private message
jcherw



Joined: 27 Sep 2018
Posts: 27
Location: Australia

PostPosted: Fri Sep 28, 2018 10:48 am    Post subject: Reply with quote

Thanks, but I am still a bit confused

From the clearwin users guide https://www.silverfrost.com/ftn95-help/clearwinp/util/64bit.aspx i understood that for the 64 bit version (of ftn95) I have to use clrwin$ and function calls ending in the $ sign.

But from the last comment I understand that for ftn95 64 bit I can also use clrwin and function calls ending in @

Is there any problem using the clrwin $ everywhere? (ie for ftn95 bit and other 64 bit fortran compilers?)
Back to top
View user's profile Send private message
PaulLaidler
Site Admin


Joined: 21 Feb 2005
Posts: 5592
Location: Salford, UK

PostPosted: Fri Sep 28, 2018 11:59 am    Post subject: Reply with quote

jcherw

The link that you provided describes how to access ClearWin+ from third party compilers such as gFortran.

For the most part you can use $ with FTN95 but it is simpler to use @ because almost all of the documentation uses @ and this is the native and historical approach. Also you might find the odd thing here and there that does not work with $.
Back to top
View user's profile Send private message
jcherw



Joined: 27 Sep 2018
Posts: 27
Location: Australia

PostPosted: Fri Sep 28, 2018 12:49 pm    Post subject: Reply with quote

Ok - thanks a lot all who commented. I'll re-jig (revert back) the code to work with clrwin and @
Back to top
View user's profile Send private message
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