Software Archive
Read-only legacy content
17061 Discussions

DLLEXPORT of data

Dalziel__Stuart
Beginner
379 Views
It seems like the DLLEXPORT attribute, when applied to data, is broken in v6.6a. Consider the following:

The following is used to create a DLL and the module M_DLL.
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

module M_DLL

integer (4) Hat

!DEC$ ATTRIBUTES DLLEXPORT :: Hat

end module

!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

A program can then USE the module and link to the DLL:

!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

program Test

use M_DLL

Hat = 1

end

!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
Under CVF6.5.0 this compiles and links OK.

Under CVF6.6A, things compile OK, but generate a link error as the program has interpreted 'Hat' as _M_DLL_mp_Hat, whereas the DLL contains M_DLL_mp_Hat. Comparing with the behaviour under 6.5.0, the USE of the module is not being handled correctly.

Is there a cure for this problem? I have not tried v6.6 yet, but can't go back to 6.5 for the main work I am doing...

Stuart.
0 Kudos
0 Replies
Reply