View previous topic :: View next topic |
Author |
Message |
seagods
Joined: 21 Jan 2019 Posts: 2
|
Posted: Thu Jan 24, 2019 8:36 pm Post subject: How to export data from a DLL |
|
|
I have a Unix background and DLLs are new to me.
I have a function, say fun1, and
dll
load fun1.obj
exportall
fle mydll
does fine, as does
dll
load fun1.obj
export FUN1=FUN1
fle mydll
but, say MAIN and FUN1 have a common block
real alpha,beta
common /mydata/alpha,beta
(The block mydata appears as _MYDATA_ in FUN1.obj but MYDATA, MYDATA, nor _MYDATA_ appear to be recognised by slink)
how do I export the data?
Surely this must be a very common thing to do. The thing is I have a lot of legacy code which I don't wish to hack.)
So far, I haven't understood the manual |
|
Back to top |
|
|
PaulLaidler Site Admin
Joined: 21 Feb 2005 Posts: 7925 Location: Salford, UK
|
Posted: Fri Jan 25, 2019 9:03 am Post subject: |
|
|
You can't export data in that way.
You might be able to pass the address of the first item in the common block. You would write a subroutine for this and export the subroutine. |
|
Back to top |
|
|
seagods
Joined: 21 Jan 2019 Posts: 2
|
Posted: Fri Jan 25, 2019 1:31 pm Post subject: export data from dll |
|
|
I had seen a couple of things on intel compiler sites where all the export and import was done via !DEC$ compiler directives and these included exporting
common blocks via "/BlockName/.
It looked as though slink is doing some clever stuff which means you don't have to touch the source code going into the DLL.
Anyway, thanks for the suggestion, I shall give it a go, but it looks like static
libraries for my legacy stuff. (Not the end of the world...) |
|
Back to top |
|
|
|