- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi all, I develop a library coded in Fortran, which should also be compiled as a dll. For this I'm using Intel(R) Visual Fortran Composer XE 2011 Update 6 Integration for Microsoft Visual Studio* 2010, 12.1.3514.2010 I'm still new to Fortran but according to my strong C/C++ insticts I want to, as usual in C, generate the DLLEXPORT magic lines by the preprocessor. So intuitively I tried the following: #define dll_export( procId ) !DEC$ ATTRIBUTES DLLEXPORT, DECORATE, ALIAS : #procId :: procId #define dll_procArgs !DEC$ ATTRIBUTES REFERENCE ... subroutine myFunc( a ) dll_export( myFunc ) dll_procArgs :: a ... end subroutine However, for compiling this I get funny error messages, like ... error #5082: Syntax error, found '::' when expecting one of: ; BLOCK BLOCKDATA PROGRAM MODULE TYPE BYTE CHARACTER ... ... which is pointing to the line dll_procArgs :: a After some testing I suspect it's the ! generated by the macros that cause the problems. So, how can I avoid the ! character by escape sequence or trigraph - and get the DLLEXPORT magic right? Thanks!
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Try this. If you're using a project, turn off the "Use preprocessor" property. Then on the Command Line page, add this under Additional Options:
/fpp:"-f_com=no"
This prevents the ! from being treated as a Fortran comment in the preprocessor line.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
![](/skins/images/D2683F18326913BBA0436CB7114DD569/responsive_peak/images/icon_anonymous_message.png)
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page