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
초급자
3,351 조회수
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,351 조회수

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

Gerry

0 포인트
Steven_L_Intel1
3,351 조회수
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 포인트
g_f_thomas
초급자
3,351 조회수

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 포인트
Steven_L_Intel1
3,351 조회수
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 포인트
g_f_thomas
초급자
3,351 조회수

Another tautology. Next.

Gerry

0 포인트
albert
초급자
3,351 조회수
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 포인트
Steven_L_Intel1
3,351 조회수
You can't. If you are exporting or importing variables, the directives are required.
0 포인트
albert
초급자
3,351 조회수
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 포인트
Steven_L_Intel1
3,351 조회수
Yes, you do.
0 포인트
chip_ray1
초급자
3,351 조회수
g.f.thomas:

Another tautology. Next.

Gerry

You are being rude, but what's new!

0 포인트
g_f_thomas
초급자
3,351 조회수

What, another tautology. Enough.

Gerry

0 포인트
응답