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

!DEC$ ATTRIBUTES DLLEXPORT

albert
Beginner
2,991 Views
Dear all,

In my application I have to share data between 2 dll's. The data is defined in a Fortran module and when using
!DEC$ ATTRIBUTES DLLEXPORT it works, however when compiling the code on a linux platforI get warning messages about the !DEC$... Is there a way to remove the !DEC$... from the Fortran modules but still being able to use the data in both dll's ?

Best Regards,

Albert
0 Kudos
11 Replies
g_f_thomas
Beginner
2,991 Views

!DEC$ is an extension. You could try f2003's deficientC interop features to get around this.

Gerry

0 Kudos
Steven_L_Intel1
Employee
2,991 Views
But there's no DLLEXPORT in the C interoperability feature.

The way I would approach this is:

!DEC$ IF DEFINED (_WIN32)
!DEC$ ATTRIBUTES DLLEXPORT :: name
!DEC$ END IF
0 Kudos
g_f_thomas
Beginner
2,991 Views

How tautological! Allthat does is assure that it's portable to Windows if one is using MSFP, Digital, Compaq, or IVF,whichwe knewalready.

Even scripting languages have superior C interop than f2003.

Gerry

0 Kudos
Steven_L_Intel1
Employee
2,991 Views
My understanding was that it was desired to avoid the warning about the unsupported DLLEXPORT attribute on Linux when using the Intel compiler there. The code I suggested would do that.

DLLEXPORT has nothing to do with C interop.
0 Kudos
g_f_thomas
Beginner
2,991 Views

Another tautology. Next.

Gerry

0 Kudos
albert
Beginner
2,991 Views
The problem is that I would like to get rid of the !DEC$... directives but still would be able to access the data from both my dll's


0 Kudos
Steven_L_Intel1
Employee
2,991 Views
You can't. If you are exporting or importing variables, the directives are required.
0 Kudos
albert
Beginner
2,991 Views
Pity that I have to use the !DEC$ ... directives.

In the near future I have to port the application to 64-bit. Do I have to use the !DEC$ in the 64-bit version as well ?

Albert
0 Kudos
Steven_L_Intel1
Employee
2,991 Views
Yes, you do.
0 Kudos
chip_ray1
Beginner
2,991 Views
g.f.thomas:

Another tautology. Next.

Gerry

You are being rude, but what's new!

0 Kudos
g_f_thomas
Beginner
2,991 Views

What, another tautology. Enough.

Gerry

0 Kudos
Reply