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

conditional compilation of DLLEXPORT attribute

Matthew_Nicoll
Beginner
289 Views

I have a library of routines from which I create an object library (.lib)  and a DLL (.dll).

I currently use a custom pre-processor which removes the  "!DEC$ATTRIBUTES DLLEXPORT :: name"  statements, (and one or two other DLL-specific statements), when I am compiling for the object library.

I am wondering if I can avoid using a pre-processor.

Would it matter if I left the "!DEC$ATTRIBUTES DLLEXPORT :: name" statements in when compiling for the object library?

 

0 Kudos
2 Replies
Steven_L_Intel1
Employee
289 Views

Having DLLEXPORT directives in code not built into a DLL is "mostly harmless". The code will work fine, but the linker will create an export library when the executable is linked, which may be annoying.

0 Kudos
IanH
Honored Contributor II
289 Views

You could use module definition files or command line options to specify the procedures to export, as an alternative to DLLEXPORT directives.

0 Kudos
Reply