Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.
29253 Обсуждение

!DEC$ ATTRIBUTES DLLEXPORT

albert
Начинающий
3 356Просмотр.
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 баллов
11 Ответы
g_f_thomas
Начинающий
3 356Просмотр.

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

Gerry

Steven_L_Intel1
Сотрудник
3 356Просмотр.
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
g_f_thomas
Начинающий
3 356Просмотр.

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

Steven_L_Intel1
Сотрудник
3 356Просмотр.
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.
g_f_thomas
Начинающий
3 356Просмотр.

Another tautology. Next.

Gerry

albert
Начинающий
3 356Просмотр.
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


Steven_L_Intel1
Сотрудник
3 356Просмотр.
You can't. If you are exporting or importing variables, the directives are required.
albert
Начинающий
3 356Просмотр.
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
Steven_L_Intel1
Сотрудник
3 356Просмотр.
Yes, you do.
chip_ray1
Начинающий
3 356Просмотр.
g.f.thomas:

Another tautology. Next.

Gerry

You are being rude, but what's new!

g_f_thomas
Начинающий
3 356Просмотр.

What, another tautology. Enough.

Gerry

Ответить