Silverfrost Forums

Welcome to our forums

How to export data from a DLL

24 Jan 2019 7:36 #23182

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

25 Jan 2019 8:03 #23186

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.

25 Jan 2019 12:31 #23188

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...)

Please login to reply.