- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
I have written some Fortran routines that I call from C on the MS Windows OS. The Fortran code is compiled into a DLL and I specify "!DEC$ ATTRIBUTES DLLEXPORT::MYROUTINE" in the routine to be exported. To use this routine from C I specify "extern __declspec(dllimport) voidMYROUTINE (int *iyear, int *iday, int *ihour, int *imin, int *iout);" Can anyone tell me how I have to change this if I want to make this work using sharable object libraries on Linux with the Intel Fortran and C compilers?
Thanks,
Haje
Link Copied
3 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
My understanding is that those directives/pragmas are not needed on Linux. Just treat it as if the code was being linked statically. It is a Windows abberation that special coding practices are needed to create or use shared libraries.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Steve,
do I read you correct that I should
1) Delete the "!DEC$ ATTRIBUTES DLLEXPORT::MYROUTINE" from the Fortran code, and
2) Change the line "extern __declspec(dllimport) voidMYROUTINE (int *iyear, int *iday, int *ihour, int *imin, int *iout);" to "extern voidMYROUTINE (int *iyear, int *iday, int *ihour, int *imin, int *iout);"?
Thanks,
Haje
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Correct.

Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page