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

Porting !DEC$ ATTRIBUTES DLLIMPORT to linux for access to .so

Reynolds__John
Beginner
790 Views

I have a DLL written in C++ on Windows, that I want to convert to a shared object library on linux. The C++ work is pretty straightforward. But to access the .so on linux, I don't know how I would change this part of the interface statement in FORTRAN:

!DEC$ ATTRIBUTES DLLIMPORT

I'm using Intel fortran compilers on both platforms, but my code needs to be portable to as many compilers as possible.

John

0 Kudos
2 Replies
Steven_L_Intel1
Employee
790 Views

You do not need a DLLIMPORT directive on Linux. Of the operating systems we support, only Windows requires these. And for Windows, you do not even need DLLIMPORT if you are calling routines (you do still need DLLEXPORT or a .DEF file to define the routines to be exported.) DLLIMPORT is required for imported variables on Windows.

0 Kudos
Reynolds__John
Beginner
790 Views

Thanks Steve.

John

0 Kudos
Reply