DLLEXPORT in modules

DLLEXPORT in modules

Does anyone have an example of a cDEC$ATTRIBUTTES DLLEXPORT statement from a data only module where the exported variables are then used in an external DLL through a USE statement? The CVF documentation mentions that it is possible but I was unable to find an example and can't seem to make it work on my own.

the code in the exporting module is as follows:

MODULE GLOBALCOMMON
...
!DEC$ATTRIBUTES DLLEXPORT :: S,TIME0,TFINAL,DELT,IWARN
...

the code in a subroutine of the other dll is as follows:
SUBROUTINE TYPE571(...)
...
USE GLOBALCOMMON, ONLY:TIME0,TFINAL,DELT
...

I have included the .lib file from the first dll in the second one's project. Any hints as to what I am doing wrong wqould be greatly appreciated.
Thanks in advance,
David

3 posts / 0 new
Last post
For more complete information about compiler optimizations, see our Optimization Notice.

What version CVF do you have? This really first started working in 6.6B.

Steve

Retired 12/31/2016

I had 6.6A but have remedied that. The errors are a bit different now. When compiling the base dll (from which I want to export the variables) I get link warnings telling me that each of the variables contained in the statement

cDEC$ATTRIBUTES DLLEXPORT :: var1, var2,...

is being imported. The warning text is

LINK : warning LNK4049: locally defined symbol "_GLOBALCOMMON_mp_var1" imported

In the second dll (where I am trying to USE the exported variables) I get the error that the name in ONLY list doesn't exist.

I really appreciate your help on all this.
Cheers,
David

Leave a Comment

Please sign in to add a comment. Not a member? Join today