View previous topic :: View next topic |
Author |
Message |
Anonymous Guest
|
Posted: Mon Aug 29, 2005 1:55 pm Post subject: Common blocks in DLLs |
|
|
Hello everybody,
almost the same question as Mr. Pannhorst:
How can in FTN95 Fortran executables share "COMMON" blocks with a DLL ? Is there any compiler/linker switch to allow that ?
Georg Duschl |
|
Back to top |
|
|
PaulLaidler Site Admin
Joined: 21 Feb 2005 Posts: 7925 Location: Salford, UK
|
Posted: Wed Aug 31, 2005 4:07 am Post subject: Common blocks in DLLs |
|
|
At the moment FTN95 does not enable you to link a common block (or module data)
across a main program and a DLL or across two DLLs. If you use the Salford
intrinsic LOC to get the addresses you will find that the two sets of data
have different address spaces.
This limitation already appears on the wish list of things to do when time and resources permit.
What is needed is an EXTERNAL attribute that can be attached to a common block (or module data)
in a way that is analogous to subprograms. Incidentally, you can embed a common block in a
module so adding the feature for a common block alone may be sufficient.
A rather poor alternative is to put all the data into one array (using EQUIVALENCE statements
for the variables) and to pass this array on each call. Since the array is passed by reference,
the overhead is minimal. You could also put the relevant code in an INCLUDEd file. |
|
Back to top |
|
|
Anonymous Guest
|
Posted: Wed Aug 31, 2005 6:47 am Post subject: Common blocks in DLLs |
|
|
Thank you Paul!
I hope, that your wish list is not too long and that you'll soon find time to inlcude this important feature.
Georg Duschl |
|
Back to top |
|
|
|