Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.

DLLEXPORT in modules

trnsys
Einsteiger
558Aufrufe
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
0 Kudos
2 Antworten
Steven_L_Intel1
Mitarbeiter
558Aufrufe
What version CVF do you have? This really first started working in 6.6B.

Steve
trnsys
Einsteiger
558Aufrufe
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
Antworten