View previous topic :: View next topic |
Author |
Message |
jcherw
Joined: 27 Sep 2018 Posts: 57 Location: Australia
|
Posted: Thu Sep 27, 2018 11:16 pm Post subject: Use of DLLs |
|
|
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 |
|
|
mecej4
Joined: 31 Oct 2006 Posts: 1886
|
Posted: Thu Sep 27, 2018 11:41 pm Post subject: |
|
|
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 |
|
|
jcherw
Joined: 27 Sep 2018 Posts: 57 Location: Australia
|
Posted: Fri Sep 28, 2018 1:06 am Post subject: |
|
|
That's exactly what I did but it did not work. |
|
Back to top |
|
|
jcherw
Joined: 27 Sep 2018 Posts: 57 Location: Australia
|
Posted: Fri Sep 28, 2018 1:12 am Post subject: |
|
|
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 |
|
|
mecej4
Joined: 31 Oct 2006 Posts: 1886
|
Posted: Fri Sep 28, 2018 1:42 am Post subject: |
|
|
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 |
|
|
jcherw
Joined: 27 Sep 2018 Posts: 57 Location: Australia
|
|
Back to top |
|
|
jcherw
Joined: 27 Sep 2018 Posts: 57 Location: Australia
|
Posted: Fri Sep 28, 2018 4:15 am Post subject: |
|
|
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 |
|
|
jcherw
Joined: 27 Sep 2018 Posts: 57 Location: Australia
|
Posted: Fri Sep 28, 2018 4:33 am Post subject: |
|
|
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 |
|
|
PaulLaidler Site Admin
Joined: 21 Feb 2005 Posts: 7924 Location: Salford, UK
|
Posted: Fri Sep 28, 2018 7:35 am Post subject: |
|
|
For FTN95 you should use @ and USE CLRWIN.
For gFortran (or both FTN95 and gFortran) you should use $ and USE CLRWIN$. |
|
Back to top |
|
|
jcherw
Joined: 27 Sep 2018 Posts: 57 Location: Australia
|
Posted: Fri Sep 28, 2018 10:48 am Post subject: |
|
|
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 |
|
|
PaulLaidler Site Admin
Joined: 21 Feb 2005 Posts: 7924 Location: Salford, UK
|
Posted: Fri Sep 28, 2018 11:59 am Post subject: |
|
|
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 |
|
|
jcherw
Joined: 27 Sep 2018 Posts: 57 Location: Australia
|
Posted: Fri Sep 28, 2018 12:49 pm Post subject: |
|
|
Ok - thanks a lot all who commented. I'll re-jig (revert back) the code to work with clrwin and @ |
|
Back to top |
|
|
|